关于在ubuntu 14.04上安装moodle的ERROR 2002(HY000)

时间:2014-06-28 05:12:18

标签: mysql ubuntu install mysql.sock

我按照以下步骤操作: 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

那么为什么会出现这个错误?

1 个答案:

答案 0 :(得分:0)

我建议在以下位置执行Apache / MySql / PHP的安装说明:

https://help.ubuntu.com/community/ApacheMySQLPHP

基本上

sudo apt-get install lamp-server^

然后按照安装Moodle的说明进行操作

http://docs.moodle.org/27/en/Installing_Moodle