0

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?

franzlorenzon
  • 5,845
  • 6
  • 36
  • 58
Blue Rose
  • 101
  • 1
  • 2
  • 6
  • possible duplicate of [ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)](http://stackoverflow.com/questions/11657829/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-var-run) – franzlorenzon Jun 29 '14 at 18:29

1 Answers1

0

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

Russell England
  • 9,436
  • 1
  • 27
  • 41