mysql root权限丢失只能看到information_schema数据库解决办法
vi /etc/mysql/mysql.conf.d/mysqld.cnf
在文件最后一行添加
skip-grant-tables
保存后,root权限登录,运行 service mysqld restart 重启mysql
执行:mysql -u root -p
Enter password: (直接回车)
执行:use mysql
Database changed
执行:flush privileges;
执行:grant all privileges on *.* to root@localhost identified by 'mysql'
OK完成了,等等,登录进去没权限?往下看!
下载/etc/my.conf 用editplus 打开去掉 skip-grant-tables
重启mysql: service mysqld restart