修改数据库密码: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