具体方法:
(推荐教程:)
首先以root身份登录MySQL
mysql -uroot
选择mysql数据库
mysql> use mysql
最后执行如下命令即可查看root密码。
mysql> select authentication_string from user where User='root'; +-------------------------------------------+ | authentication_string | +-------------------------------------------+ | *781D25322166DB7FF99BA4A1FA5ED30439A60DDE | +-------------------------------------------+ 1 row in set (0.01 sec)