MySql Error 1698(28000)问题的解决方法
16lz
2021-12-30
一,问题描述:
MysqlERROR1698(28000)解决,新装了mysql-server-5.7,登录为这一问题,普通用户不能进mysql,只有root用户才能进,并且不需要任何密码。
~$ mysql -u root -pEnter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost'
停止mysql服务
~$ sudo service mysql stop
~$ sudo mysqld_safe --skip-grant-tables &
~$ mysql -u rootWelcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.10 MySQL Community Server (GPL)
mysql> select user, plugin from mysql.user;+-----------+-----------------------+| user | plugin |+-----------+-----------------------+| root | auth_socket || mysql.sys | mysql_native_password || dev | mysql_native_password |+-----------+-----------------------+<strong>3</strong> rows in set (<strong>0.01</strong> sec)
mysql> update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';Query OK, <strong>1</strong> row affected, <strong>1</strong> warning (<strong>0.00</strong> sec)Rows matched: <strong>1</strong> Changed: <strong>1</strong> Warnings: <strong>1</strong>mysql> flush privileges;Query OK, <strong>0</strong> rows affected (<strong>0.00</strong> sec)
~$ sudo service mysql stop... * MySQL Community Server 5.7.10 is stopped~$ sudo service mysql start.. * MySQL Community Server 5.7.10 is started~$ mysql -u root -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: 5.7.10 MySQL Community Server (GPL)
更多相关文章
- Linux下MYSQL 5.7 找回root密码的问题(亲测可用)
- Android(安卓)10 定位问题,获取NMEA(支持5.0~10.0)
- mybatisplus的坑 insert标签insert into select无参数问题的解决
- 关于Android(安卓)Studio3.2新建项目Android(安卓)resource link
- Android软键盘适配问题
- SlidingMenu和ActionBarSherlock结合做出出色的App布局,Facebook
- android解决坚屏拍照和保存图片旋转90度的问题,并兼容4.0
- Android(安卓)Calendar使用过程中遇到的问题
- flutter-使用第三方库,编译和运行版本不一致问题 2