标签:oca 用户访问 用户 erro roo ble root pass 使用
这个问题最开始查资料都说要改密码,密码不对。其实不是这个样子都。
解决方法
/etc/mysql/my.cnf
,添加以下内容[mysqld] skip-grant-tables
/etc/init.d/mysql restart
mysql -u root
连接select user, plugin from mysql.user;
+------------------+-----------------------+ | user | plugin | +------------------+-----------------------+ | root | auth_socket | | mysql.session | mysql_native_password | | mysql.sys | mysql_native_password | | debian-sys-maint | mysql_native_password | +------------------+-----------------------+
update mysql.user set authentication_string=PASSWORD(‘pass‘),plugin=‘mysql_native_password‘ where user=‘root‘;
将root都密码修改为passflush privileges;
刷新一下修改过后user表就变这样了
+------------------+-----------------------+
| user | plugin |
+------------------+-----------------------+
| root | mysql_native_password |
| mysql.session | mysql_native_password |
| mysql.sys | mysql_native_password |
| debian-sys-maint | mysql_native_password |
+------------------+-----------------------+
MySQL使用普通用户访问返回ERROR 1698 (28000): Access denied for user 'root'@'localhost'
标签:oca 用户访问 用户 erro roo ble root pass 使用
原文地址:https://www.cnblogs.com/zhuxiaoxi/p/9903167.html