MySQL数据库的安装教程:
Microsoft Windows [版本 10.0.18362.657]
(c) 2019 Microsoft Corporation。保留所有权利。
C:\WINDOWS\system32>cd/d G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysqld -install
Service successfully installed.
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysqld --initialize-insecure --user=mysql
mysqld: Can't create directory 'D:\Program Files\mysql-5.7\data\' (Errcode: 2 - No such file or directory)
2020-02-22T09:07:34.050403Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-02-22T09:07:34.553838Z 0 [ERROR] Aborting
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysqld --initialize-insecure --user=mysql
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysql -u root -p 进入mysql
Enter password:
ERROR 1049 (42000): Unknown database '½øÈëmysql'
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.19 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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> update mysql.user set authentication_string=password('123456') where user='root' and Host = 'localhost';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>net stop mysql
MySQL 服务正在停止.
MySQL 服务已成功停止。
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.19 MySQL Community Server (GPL)
Copyright (c) 2000, 2017, 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> exit
Bye
G:\MySQL-5.7\Environment\mysql-5.7.19\mysql-5.7.19-winx64\bin>
最终成功界面:
详细教程,下一篇博文更新!