Mysql configuration

Solve the problems of starting the server of Mysql, changing the initial password and connection in workbench. If you get any problems, please give feedback to us.

切换到mysql server文件夹下,开启服务

1
2
C:\Program Files\MySQL\MySQL Server 8.0>net start mysql
服务名无效。
1
2
3
4
5
6
C:\Program Files\MySQL\MySQL Server 8.0>mysqld --install
Service successfully installed.

C:\Program Files\MySQL\MySQL Server 8.0>net start mysql
MySQL 服务正在启动 ...
MySQL 服务已经启动成功。

打开服务后,在mysqlworkbench中尝试连接,密码要从C:\Program Files\MySQL\MySQL Server 8.0\data下的.err文件中查看

找到你文件中类似如下log信息

1
2019-05-30T10:11:32.700142Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ty.)Vv_y#6uU

root@localhost后的一串乱码就是你第一次登陆的密码。

在workbench登陆之前需要改动密码

先进入mysql

1
2
C:\Program Files\MySQL\MySQL Server 8.0>mysql -u root -p
Enter password: ********

1
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'fuck';

就可以在workbench中以fuck为密码登陆了