ERROR 2002 (HY000) on installing moodle on ubuntu 14.04

789 Views Asked by At

I follow the steps in: http://docs.moodle.org/27/en/Step-by-step_Install_Guide_for_Ubuntu

and in step 6, after typing the following command :

mysql -u root -p

I have this error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

And when I go to the '/var/run/mysqld I can't found mysqld.sock although in file(/etc/mysql/my.cnf)the :

[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

So why this error?

1

There are 1 best solutions below

0
On

I would recommend following the installation instruction for Apache/MySql/PHP at :

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

Basically

sudo apt-get install lamp-server^

Then follow the instructions for installing Moodle

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