D:\software\mysql-8.0.13-winx64>net start mysql
服务名无效。
请键入 NET HELPMSG 2185 以获得更多的帮助。
需要先执行以下命令:
mysqld -install
此时得到执行结果如下:
D:\software\mysql-8.0.13-winx64>mysqld -install
Service successfully installed.
接着再次启动MySQL服务,得以成功:
D:\software\mysql-8.0.13-winx64>net start mysql
MySQL 服务正在启动 ....
MySQL 服务已经启动成功。
登录MySQL
执行命令:
mysql -u root -p
此时会提示输入密码,由于初次登录MySQL,无需输入密码,所以直接回车即可,登录成功结果如下:
D:\software\mysql-8.0.13-winx64>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.13 MySQL Community Server - GPL
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 current input statement.
mysql>
查询用户密码
执行命令如下:
select host,user,authentication_string from mysql.user;