0

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

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

4

1 回答 1

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

于 2014-06-29T07:43:28.760 回答