Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
(/var/lib/mysql/localhost.localdomain.pid).

please help me

share|improve this question
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

2 Answers 2

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.

share|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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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