我错误地从mysql.user表中删除了根用户。delete from mysql.user where user='username';CREATE USER 'username'@'localhost回答delete from mysql.db where user='username';
就这样..。
在用一个更大更快的mysql替换了我的磁盘之后,我正在尝试安装MySQL。在ubuntu上安装mysql-server后,运行select user,host,authentication_string from user where user='root';时,authentication_string我设置了密码,但登录到root的唯一方法是使用sudo运行MySQL命令,如果我试图输入密码,如果我运行mysql -u root -p,它就不能工作。