MySQL抱错解决问题
mysql 出现问题
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
解决方方法:
ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sockln
还有就是去配置文件
mysqld]
#skip-grant-tables
datadir=/usr/local/mysql/data/
#datadir = /opt/mysql/data
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[client]
#password = your_password
port = 3306
socket = /var/lib/mysql/mysql.sock
mysql_secure_installation
报错 Starting MySQL. ERROR! The server quit without updating PID file (/opt/mysql/data/server.qtf.com.pid)
配置文件路径跟初始化路径不一样
mysql -S /var/lib/mysql/mysql.sock