code
vi /etc/my.cnf
1.找不到初始密碼可以在my.ini中[mysqld] 添加:
skip-grant-tables
2.修改MySQL數據庫配置文件無密碼登錄后,修改密碼報錯:
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
3.先執行:
flush privileges;
4.再執行修改密碼命令,可以了:
set password for root@localhost=password('你的密碼');