下载地址: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