C:\Program Files\mysql-8.0.12-winx64\bin λ mysqld --install Service successfully installed.
C:\Program Files\mysql-8.0.12-winx64\bin λ net start mysql MySQL 服务正在启动 . MySQL 服务已经启动成功。
更改密码
在MySQL安装目录的 bin 目录下执行命令: mysql -u root -p
这时候会提示输入密码,刚刚的初始密码 进去后:修改密码如下代码
1
ALTERUSER'root'@'localhost' IDENTIFIED WITH mysql_native_password BY'新密码';
结果
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
C:\Program Files\mysql-8.0.12-winx64\bin λ mysql -u root -p Enter password: ************ Welcome to the MySQL monitor. Commands endwith ; or \g. Your MySQL connection id is8 Serverversion: 8.0.12
Copyright (c) 2000, 2018, 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 currentinputstatement.