使用
1 | mysql -u root -p |
启动Mysql报错
1 | ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) |
然后
1 | su - |
还是出现
1 | ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) |
发现是service 这里可能会有问题
用绝对路径启动就行了
1 | /etc/init.d/mysqld start |
启动Mysql
完整命令
1 | su - |