1 登录数据库–不输入密码才能登录
mysql -u root -p
- 输入密码报错如下,直接回车跳过可以进入数据库
- Enter password: ******
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
2 查看root 用户
select user,host from mysql.user;
use mysql;
update user set authentication_string='' where user='root';
flush privileges;
alter user 'root'@'localhost' identified with mysql_native_password by '000000';
3 在navicat 连接中报错
the user specified as a definer(mysql.infoschema@localhost dose not exist)…
解决查看infoschema 表是否存在,存在则删除重建
SELECT User, Host FROM mysql.user WHERE User = 'mysql.infoschema';
DROP USER 'mysql.infoschema'@'localhost';
FLUSH PRIVILEGES;
CREATE USER 'mysql.infoschema'@'localhost' IDENTIFIED BY '000000';
GRANT SELECT ON *.* TO 'mysql.infoschema'@'localhost';
FLUSH PRIVILEGES;