0

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

5
  • 2
    Did you try following what the error message told you? May 12, 2011 at 13:31
  • both the cases are true mysqld not running and mysql.sock doesn't exist May 12, 2011 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, 2011 at 13:45
  • 1
    Any log details would be welcome.
    – Agemen
    May 12, 2011 at 14:54
  • Have you tried the suggestions made by Bigmyx ?
    – Agemen
    May 13, 2011 at 6:24

2 Answers 2

3

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.

7
  • @Agemen MySQL is not running. How to start mysql May 12, 2011 at 13:33
  • service mysqld start May 12, 2011 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) May 12, 2011 at 13:40
  • I am accessing it using SSH. Is there any option that blocks remote access May 12, 2011 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, 2011 at 14:56
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .