直接使用/etc/mysql/debian.cnf文件中[client]节提供的用户名和密码:
# mysql -udebian-sys-maint -p
enter password: <输入[client]节的密码>
mysql> update user set password=password('newpassword') where user='root';
mysql> flush privileges;
mysql> quit
# mysql -uroot -p
enter password: <输入新设的密码newpassword>
mysql>
CREATE USER user IDENTIFIED BY 'pass';
GRANT ALL PRIVILEGES ON *.* TO user;