以下操作用戶部分好像不生效韧掩,可參考該博文:https://www.cnblogs.com/wangyueping/p/11258028.html
啟動(dòng)mysql以及修改密碼
E:\02_Developer\01_DevEnv\Mysql\mysql-5.5.10-winx64\bin>net start mysql
MySQL 服務(wù)正在啟動(dòng) .
MySQL 服務(wù)已經(jīng)啟動(dòng)成功。
- 輸入mysql -u root -p 回車洛心,不用輸入密碼,繼續(xù)回車進(jìn)入數(shù)據(jù)庫(kù)
- 輸入 use mysql進(jìn)入mysql數(shù)據(jù)庫(kù)蚌铜;
- 輸入 update mysql.user set authentication_string=password('123456') where user='root';設(shè)置數(shù)據(jù)庫(kù)密碼 適用于mysql 5.7版本秕噪;
- 將修改 mysql中的 My.ini文件,刪掉最后一行的代碼(跳過表驗(yàn)證)skip-grant-tables陷虎;
- 在cmd命令行窗口輸入命令重啟服務(wù)。
net stop mysql;
net start mysql;
以上操作
E:\02_Developer\01_DevEnv\Mysql\mysql-5.5.10-winx64\bin>net start mysql
MySQL 服務(wù)正在啟動(dòng) .
MySQL 服務(wù)已經(jīng)啟動(dòng)成功杠袱。
E:\02_Developer\01_DevEnv\Mysql\mysql-5.5.10-winx64\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql
Database changed
mysql> update mysql.user set authentication_string=password('123456') where user
='root';
Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> exit
Bye