"Issue 1" installs MySQL directly on centos6.8 using Yum, and everything is installed properly. Show when MySQL starts:
ERROR 2002 (HY000): Can ' t connect to local MySQL server through socket '/var/lib/mysql/mysql.sock ' (2)
(1), cp/usr/share/mysql/my-medium.cnf//etc/my.cnf (Copy the default profile template in the past to overwrite the original configuration file);
(2),/etc/init.d/mysqld Status View MySQL running status, display normal;
(3), the solution:
vim/etc/my.conf, add a sentence below [mysqld]:
[Mysqld] (don't add the words)
Datadir=/usr/local/mysql/data
"Now directly enter MySQL directly into the MySQL command window"
"Issue 2" cannot be logged in with Mysql-u root-p, which shows:
ERROR 1045 (28000): Access denied for user ' mysql ' @ ' localhost ' (using Password:no)
Workaround:
In MySQL configuration file/etc/my.conf, in [Mysqld], add:
Pid-file=/var/lib/mysql/mysqlid.pid
reason:the MySQL user does not operate the/var/run directory permissions, so the PID file can not be created, resulting in the login can not establish process information files, the login process can not be opened, nature can not login.
。。。。。。。。。。 Continue to update ... ..... .... ... .... ..... ..... ..... ..... ..... .....................
Two problems and workarounds for using MySQL under centos6.8