MySQL启动失败

0

这次直接使用的tar.gz安装的,遇到了一些新问题:

首先版本升级到了5.6,配置编码改为:character-set-server=utf8

150717 18:36:55 [ERROR] Can't start server : Bind on unix socket: Permission denied
150717 18:36:55 [ERROR] Do you already have another mysqld server running on socket: /var/lib/mysql/mysql.sock ?
150717 18:36:55 [ERROR] Aborting

这个因为MySQL用户没有权限对/var/lib/mysql读写

如果提示:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

需要在my.cnf里面配置:

[client]
socket=/var/lib/mysql/mysql.sock

如果密码设置错误,可以使用./mysql --skip-grant-tables启动就不要密码了,设置密码时应该用password("");加密,不应该用md5("");

授权:grant all on *.* to root@'%';

授权提示:ERROR 1045 (28000): Access denied for user 'root'@'%' (using password: YES)
需要这样启动(用户没有权限):./mysql --skip-grant-tables

如果提示:ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
这个时候应该先刷新权限:flush privileges;

安装教程:http://blog.csdn.net/zhanngle/article/details/41042631