mysql5.7解压版安装

mysql5.7解压版安装包:https://pan.baidu.com/s/1smTisNz 点击打开链接

解压后,在环境变量中path下配置到bin目录下

Microsoft Windows [版本 10.0.14393]
(c) 2016 Microsoft Corporation。保留所有权利。
C:\WINDOWS\system32>e:
E:\>CD E:\Doo\mysql-5.7.15-winx64\bin
E:\Doo\mysql-5.7.15-winx64\bin>mysqld install
Service successfully installed.

E:\Doo\mysql-5.7.15-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务无法启动。
服务没有报告任何错误。
请键入 NET HELPMSG 3534 以获得更多的帮助。


然后将my-default.ini文件改名为my.ini,移动到bin/目录下
E:\Doo\mysql-5.7.15-winx64\bin>mysqld --initialize --user=mysql --console
2017-12-12T09:12:21.546970Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-12-12T09:12:22.090384Z 0 [Warning] InnoDB: New log files created, LSN=45790
2017-12-12T09:12:22.151545Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2017-12-12T09:12:22.220756Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 8fc4bd9e-df1c-11e7-a262-1866da1cf58e.
2017-12-12T09:12:22.225773Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2017-12-12T09:12:22.233763Z 1 [Note] A temporary password is generated for root@localhost: Glkq2Y7=lvf/

E:\Doo\mysql-5.7.15-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

记住上面自动生成的密码,登录:
E:\Doo\mysql-5.7.15-winx64\bin>mysql -uroot -pGlkq2Y7=lvf/
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.15
Copyright (c) 2000, 2016, 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> set password=password('root');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> exit
Bye

新密码登录:
E:\Doo\mysql-5.7.15-winx64\bin>mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.7.15 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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

猜你喜欢

转载自blog.csdn.net/qq_36135928/article/details/79257907