首页 > 代码库 > MySQL5.7-winx64的zip包安装过程
MySQL5.7-winx64的zip包安装过程
首先将下载完成zip包解压到某个目录,如:E:\mysql-5.7.16-winx64
修改环境变量path增加E:\mysql-5.7.16-winx64\bin
在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包安装过程
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。