修改數據庫密碼:mysql
mysql -u root -p Enter password:*** mysql>use mysql; 選擇數據庫 Database changed mysql> UPDATE user SET password=PASSWORD("新密碼") WHERE user='你的用戶名'; mysql> FLUSH PRIVILEGES; mysql> quit;
更改用戶名:sql
mysql -u root -p Enter password:*** mysql> use mysql; 選擇數據庫 Database changed mysql> update user set user="新用戶名" where user="root"; 將用戶名爲root的改成新用戶名 mysql> flush privileges; 刷新權限 mysql> exit