江蘇網(wǎng)站制作企業(yè)最近新聞報道
1、在windows services 中停止mysql8 服務(wù)。
2、進入mysql8 安裝目錄,D:\Program Files\mysql-8.0.16-winx64\bin
以免密方式啟動數(shù)據(jù)庫:
mysqld --console --skip-grant-tables --shared-memory
3、以免費方式登錄數(shù)據(jù)庫:
D:\Program Files\mysql-8.0.16-winx64\bin>mysql -udev001 -P13306
注意此行命令不能加 -p,
-P為數(shù)據(jù)庫端口
4、
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> SELECT ssl_type From mysql.user Where user="dev001";
+----------+
| ssl_type |
+----------+
| X509 |
+----------+
1 row in set (0.01 sec)mysql> update user set ssl_type='' where user='dev001';
ERROR 1046 (3D000): No database selected
mysql> use mysql;
Database changed
mysql> update user set ssl_type='' where user='dev001';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.03 sec)mysql> ALTER USER 'dev001'@'%' IDENTIFIED BY '密碼';
Query OK, 0 rows affected (0.01 sec)mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)mysql> exit
Bye
5、關(guān)閉免費登錄窗口
6、啟動windows service 中的mysql服務(wù)
7、使用新密碼登錄數(shù)據(jù)庫。