Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Nov 11, 2012 3:34 am 
Offline
Senior Newbie

Joined: Sun Nov 11, 2012 3:29 am
Posts: 7
I am trying to reset my mysql root password using the following approach:

Code:
/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
mysql> use mysql;
mysql> update user set password=PASSWORD("newrootpassword") where User='root';
mysql> flush privileges;
mysql> quit
/etc/init.d/mysql stop
/etc/init.d/mysql start


However, when I execute

Code:
/etc/init.d/mysql stop


I get ..

Code:
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql


So then I try..

Code:
sudo service mysql stop


And then when I try to restart mysqld with

Code:
mysqld_safe --skip-grant-tables &


I get..

Code:
121111 07:32:29 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
121111 07:32:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

[1]  + 24469 done       mysqld_safe --skip-grant-tables


Then when I try to connect as root, I get..

Code:
 ~  mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


I'm not really sure where to go from here. I'd appreciate any help.

Thanks!


Top
   
PostPosted: Sun Nov 11, 2012 4:47 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Hmm, it looks like either the mysqld process you're starting with mysqld_safe is exiting, or it's not listening on the expected socket.

You can check if the process is still running with ps awwwx | grep [m]y. If it is, try connecting to it over a network port instead: mysql -u root --protocol=TCP -P 3306. If it isn't, look at the log files for an idea as to why it's exiting.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group