phpスクリプトでデータベースを接続すると、次のように表示されます。
Could not connect: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
ユーザー名とパスワードは正しいです。
の何かmy.cnf
[client]
#password = your_password
port = 3306
socket = /data/mysql/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /data/mysql/mysql.sock
skip-external-locking
ps:socket = /var/lib/mysql/mysql.sock
phpスクリプトに変更しても「/var/lib/mysql/mysql.sock」と表示されますか?次に実行します
mysqladmin -u root -p status
それが示している
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
service mysqld restart
mysqld: unrecognized service