下載地址:https://dev.mysql.com/downloa...mysql
[mysqld] basedir=C:\\software\Mysql\mysql-5.7.14-winx64 datadir=C:\\software\Mysql\mysql-5.7.14-winx64\data port=3306
mysqld --initialize --user=mysql --console
mysqld --install MySQL
net start mysql
mysqld --remove
mysql -u root -p
skip-grant-tables
net stop mysql
和net start mysql
mysql -u root -p
不需輸入密碼,直接enter
。use mysql
select * from user
;update user set authentication_string = password("root") where user="root";
skip-grant-tables
去掉,從新啓動mysql服務 進到到mysql數據庫,在使用sql指令的時候,若是出現如下的錯誤:sql
mysql> show databases; ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
增長三句指令:數據庫
step 1: SET PASSWORD = PASSWORD('your new password');
微信
step 2: ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
this
step 3: flush privileges;
spa
在step1 時,your new password是隨便你本身寫的!.net
這是文字版:code
下面是成功的圖!blog
若是文章有錯的地方歡迎指正,你們互相交流。習慣在微信看技術文章,想要獲取更多的Java資源的同窗,能夠 關注微信公衆號:Java3y