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!