I'm experiencing some problems while trying to change mysql's root password

I have just installed mysql in redhat. I am trying to execute /usr/bin/mysqladmin -u root password "password" but it is showing some error as below

/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 
'Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (2)'

Check that mysqld is running and that the socket:
'/var/lib/mysql/mysql.sock' exists!

I have tried "service mysqld start" but its showing some error

Starting MySQL..The server quit without updating PID file

please help me

  • 2
    Did you try following what the error message told you? – Ignacio Vazquez-Abrams May 12 '11 at 13:31
  • both the cases are true mysqld not running and mysql.sock doesn't exist – satheesh.droid May 12 '11 at 13:36
  • This is an exact dupe or cross post of your earlier answer, and it is a question about mysql, not really about passwords... – Rory Alsop May 12 '11 at 13:45
  • 1
    Any log details would be welcome. – Agemen May 12 '11 at 14:54
  • Have you tried the suggestions made by Bigmyx ? – Agemen May 13 '11 at 6:24

I think you should try, first :

service mysqld status

If it's not running you should try to launch it :

service mysqld start

(or equivalent) to be sure the service is actually running. Then, check the user that is supposed to use mysqladmin has sufficient right (even if the error wouldn't be this one if he hadn't). Finally, check that your database is listening on the good port.

Note that you can use service only as root, or with the proper sudo access.

Because of this message :

Starting MySQL..The server quit without updating PID 
file (/var/lib/mysql/localhost.localdomain.pid).

You could try to move/remove the said file, and try to start your server again.

| improve this answer | |
  • @Agemen MySQL is not running. How to start mysql – satheesh.droid May 12 '11 at 13:33
  • service mysqld start – Bart De Vos May 12 '11 at 13:38
  • I have tried it but showing following error: Starting MySQL..The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid) – satheesh.droid May 12 '11 at 13:40
  • I am accessing it using SSH. Is there any option that blocks remote access – satheesh.droid May 12 '11 at 13:47
  • Edited my post according to TiZon suggestion. remote acces through ssh shouldn't be a problem. Add the result of service mysqld start to your main post ;-) – Agemen May 12 '11 at 14:56

See the error in the log file in /var/lib/mysql/hostname.err Check the permissions of /var/lib/mysql/db_dir directories Or try to run mysqld mannually and see the error in the command's output.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.