我按照以下步骤操作: http: //docs.moodle.org/27/en/Step-by-step_Install_Guide_for_Ubuntu
在第 6 步中,输入以下命令后:
mysql -u root -p
我有这个错误:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
当我去'/var/run/mysqld
我找不到mysqld.sock虽然在文件(/etc/mysql/my.cnf
)中:
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Here is entries for some specific programs
# The following values assume you have at least 32M ram
# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
那么为什么会出现这个错误呢?