Skip to main content

How to change mysql root password through ssh on linode

How to change mysql root password through ssh on linode
/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

if have error that there is no password then
mysql>use mysql;
mysql>show tables;
mysql> describe user;
update user set authentication_string=password('1111') where user='root';

Comments