Centos6在rpm安裝
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum install mysql-server –y
啟動
service mysqld start
初始化
mysql_secure_installation
Enter current password for root (enter for none):
Set root password? [Y/n]
Remove anonymous users? [Y/n]
Disallow root login remotely? [Y/n]
Remove test database and access to it? [Y/n]
Reload privilege tables now? [Y/n]
啟動mysql:
mysql –uroot –p******
下載好的rpm包安裝:
tar –zxvf MySQL-5.6.31-1.linux_glibc2.5.x86_64.rpm-bundle.tar –C /opt
cd /opt
rpm –ivh MySQL-devel-5.6.31-1.el6.x86_64.rpm
rpm –ivh MySQL- embedded -5.6.31-1.el6.x86_64.rpm
rpm –ivh MySQL-shared-5.6.31-1.el6.x86_64.rpm
rpm –ivh MySQL-server-5.6.31-1.el6.x86_64.rpm
rpm –ivh MySQL-client-5.6.31-1.el6.x86_64.rpm
rpm –ivh MySQL-test-5.6.31-1.el6.x86_64.rpm
默認安裝目錄和數據目錄
配置文件目錄: /etc/my.cnf
服務名mysql : /etc/init.d/mysql
bin目錄 : /usr/bin
lib目錄 : /usr/lib64/mysql
include目錄 : /usr/include/mysql
默認data目錄 : /var/lib/mysql
啟動:service mysql start
查詢密碼cat /root/.mysql_secret
進入mysql:mysql –uroot –p******
安裝過程中可能遇到的問題:
1. libmysqlclient.so和libmysqlclient_r.so報錯
可以安裝的時候—skip-broken跳過依賴也可以建立軟鏈接
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib/libmysqlclient.so.18
2. Starting MySQL. ERROR!The server quit without updating PID file (/usr/local/mysql/data/localhost.localmain.pid).
這個可以看下具體位置的error文檔,里面有顯示哪里出的問題,還有一個方式是完全卸載mysql重新安裝,要注意刪除/etc/my.cnf /usr/lib64/mysql
/usr/lib/mysql關於mysql的都刪除
3.安裝時候顯示已經安裝了舊版本,就用rpm –e –nodeps ****卸載就可以了
