码迷,mamicode.com
首页 > 数据库 > 详细

MySQL5.7-winx64的zip包安装过程

时间:2016-10-15 14:30:08      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:mysql5.7 zip包 winx64

  1. 首先将下载完成zip包解压到某个目录,如:E:\mysql-5.7.16-winx64

  2. 修改环境变量path增加E:\mysql-5.7.16-winx64\bin

  3. 在E:\mysql-5.7.16-winx64目录中新建目录data,将默认的my-default.ini复制为my.ini,同时配置以上字段:



basedir = E:\mysql-5.7.16-winx64
datadir = E:\mysql-5.7.16-winx64\data
port = 3306
server_id = 1

将最后一行注释

#sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES


安装MySQL服务

E:\mysql-5.7.16-winx64\bin>mysqld --install MySQL



初始化MySQL,以管理员身份运行cmd,进入到mysql的bin目录运行


mysqld --initialize --user=mysql  --explicit_defaults_for_timestamp --console

mysql-5.7.16-winx64\bin>mysqld --initialize --user=mysql  --explicit_defaults_for_timestamp --console
2016-10-15T04:38:46.341663Z 0 [Warning] InnoDB: New log files created, LSN=45790
2016-10-15T04:38:46.908164Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2016-10-15T04:38:47.111607Z 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: 42dda920-9291-11e6-a48e-00ff6bd10585.
2016-10-15T04:38:47.161759Z 0 [Warning] Gtid table is not ready to be used. Table ‘mysql.gtid_executed‘ cannot be opened.
2016-10-15T04:38:47.182800Z 1 [Note] A temporary password is generated for root@localhost: K9Otza#ftMss

注意看最后一行 的密码输出

A temporary password is generated for root@localhost: K9Otza#ftMss

启动服务

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


以上面的密码登陆

E:\mysql-5.7.16-winx64\bin>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.16

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

修改管理员密码:

E:\mysql-5.7.16-winx64\bin>mysqladmin -uroot -p password
Enter password: ************
New password: ******
Confirm new password: ******

使用新密码登陆验证

E:\mysql-5.7.16-winx64\bin>mysql -uroot -p123456
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 6
Server version: 5.7.16 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>

关闭MySQL服务

E:\mysql-5.7.16-winx64\bin>mysqladmin -uroot -p shutdown
Enter password: ******

启动MySQL服务

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


本文出自 “sunny” 博客,请务必保留此出处http://francis198.blog.51cto.com/720670/1862151

MySQL5.7-winx64的zip包安装过程

标签:mysql5.7 zip包 winx64

原文地址:http://francis198.blog.51cto.com/720670/1862151

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!