下邊連接:https://www.cnblogs.com/zero-gg/p/8875598.html,大神的結晶啊,我就悄悄的留下來自己用,鏈接缺少的部分補充下:
1.包的下載方法:wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
2.以下是報錯:
(1)啟動報錯:
[root@localhost mysql]# service mysqld start Starting MySQL.Logging to '/usr/local/mysql/data/localhost.localdomain.err'. 2019-01-11T15:41:22.170582Z mysqld_safe Directory '/var/lib/mysql' for UNIX socket file don't exists. ERROR! The server quit without updating PID file (/usr/local/mysql/data/localhost.localdomain.pid)
修復方法:
目錄不存在,創建這個目錄,並且將目錄賦予給mysql用戶
mkdir /var/lib/mysql
chown -R mysql /var/lib/mysql
然后再啟動
(2)報錯:-bash: mysql: command not found
修復:https://blog.csdn.net/myroncham/article/details/82892973
(3)報錯:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
修復:https://blog.csdn.net/vv19910825/article/details/82979563