我需要重置我本地mysql安装的root密码,但它不会让我.我试过这个:
$sudo /etc/init.d/mysql stop
* Stopping MySQL database server mysqld [ OK ]
[1]- Exit 1 sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking
[2]+ Exit 1 sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking
reg@regDesktopHome:~$sudo mysqld --skip-grant-tables &
[1] 13651
reg@regDesktopHome:~$140627 19:02:02 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
reg@regDesktopHome:~$mysql -u root mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
reg@regDesktopHome:~$sudo mysql -u root mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[1]+ Exit 1 sudo mysqld --skip-grant-tables
如何重置密码?
编辑1
我懂了:
$ps ax| grep mysql
16515 ? Ssl 0:00 /usr/sbin/mysqld
16551 pts/23 S+ 0:00 grep --color=auto mysql
reg@regDesktopHome:~/semios/v3upgrade$sudo kill -9 16515
reg@regDesktopHome:~/semios/v3upgrade$ps ax| grep mysql
16678 ? Ssl 0:00 /usr/sbin/mysqld
16715 pts/23 S+ 0:00 grep --color=auto mysql
reg@regDesktopHome:~/semios/v3upgrade$mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
看起来像进程一旦我杀了它就会自动重启mysql …