0

I am a newbie in LAMP administration. I have tried a few times installing mysql. Currently, i have MySQL 5.0 installed in my CentOS 5.5 desktop.After changing the MySQL versions a few times, i still got the error.

I am always stuck with these 2 errors here:

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)    
Access denied for user 'root'@'localhost' (using password: NO)

Whenever i managed to solve either 1, another 1 error would occur.

These are my link reference: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

http://www.webhostingtalk.com/showthread.php?t=875255

I also have already tried to reset the root password.

And whenever i logged in the mysql through:

mysqld_safe --skip-grant-tables &, 

i will always end up with:

Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

Can anyone help me solve this please?

Community
  • 1
  • 1
shuda103
  • 1
  • 1

1 Answers1

0

Ensure that you have started mysql server

    service mysqld start

by root permission

saravanakumar
  • 1,747
  • 4
  • 20
  • 38
  • 1
    Since the error message clearly mentions `Access denied for user 'root'@'localhost' (using password: NO)` it implies that the server is running, they need to provide a valid password – Hanky Panky Feb 26 '14 at 07:18
  • @Hanky웃Panky ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) this occurs when service is stoped – saravanakumar Feb 26 '14 at 07:20
  • everytime i tried to access mysql, i did start the mysqld. and, i have never set any password for root yet actually. the reason why am confused i cannot access without password. – shuda103 Feb 26 '14 at 08:23