[justin@xen20-vm04 "]$ rpm -ivh MySQL-server-5.1.51-1.glibc23.x86_64.rpm
error: Failed dependencIEs:
MySQL conflicts with MySQL-5.0.45-7.el5.x86_64
報錯沖突
[justin@xen20-vm04 "]$ rpm -qa | grep -i MySQL
MySQL-5.0.45-7.el5
卸載已有版本
[justin@xen19-vm04 "]$ rpm -e MySQL-5.0.45-7.el5
error: package MySQL-5.0.45-7.el5 is not installed
進入root用戶
[justin@xen19-vm04 "]$ sudo su -
PassWord:
[root@xen20-vm04 justin]# rpm -e MySQL-5.0.45-7.el5
[root@xen20-vm04 justin]# rpm -qa | grep -i MySQL
現在重新安裝
[root@xen20-vm04 justin]# rpm -ivh MySQL-server-5.1.51-1.glibc23.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
PLEASE REMEMBER TO SET A PASSWord FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/MySQLadmin -u root password "new-passWord"
/usr/bin/MySQLadmin -u root -h xen20-vm04 password "new-passWord"
Alternatively you can run:
/usr/bin/MySQL_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/MySQLbug script!
Starting MySQL.[ OK ]
安裝完成後找不到/ect/my.cnf文件
Linux下用rpm包安裝的MySQL是不會安裝/etc/my.cnf文件的,
至於為什麼沒有這個文件而MySQL卻也能正常啟動和作用,在點有兩個說法,
第一種說法,my.cnf只是MySQL啟動時的一個參數文件,可以沒有它,這時MySQL會用內置的默認參數啟動,
第二種說法,MySQL在啟動時自動使用/usr/share/mysql目錄下的my-medium.cnf文件,這種說法僅限於rpm包安裝的MySQL,
解決方法,只需要復制一個/usr/share/MySQL目錄下的.cnf文件到/etc目錄,並改名為my.cnf即可