2016年12月27日 星期二

[MySQL]change root password


>sudo /etc/init.d/mysql stop
>sudo mysqld_safe --skip-grant-tables &


Starting mysqld daemon with databases from /var/lib/mysql
(continue typing)
mysql -u root

>use mysql;
>update user set authentication_string = password('root') where user = 'root' ;
>FLUSH PRIVILEGES;

沒有留言:

張貼留言