使用5个步骤完成在windows7下安装mysql-5.7.10-winx64.zip
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了使用5个步骤完成在windows7下安装mysql-5.7.10-winx64.zip,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2951字,纯文字阅读大概需要5分钟。
内容图文
1、把下载得到的mysql安装包解压后得到如下目录结构
D:\JackGao\Downloads\mysql-5.7.10-winx64\bin
2、修改ini文件:D:\JackGao\Downloads\mysql-5.7.10-winx64\my-default.ini
在[mysqld]后面添加
basedir=D:\JackGao\Downloads\mysql-5.7.10-winx64
datadir=D:\JackGao\Downloads\mysql-5.7.10-winx64\data
port=3306
#这一句解决有IPV6协议的计算机上默认采用IPV6协议导致无法从程序连接数据库的问题
bind-address=127.0.0.1
# 允许最大连接数
max_connections = 200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server = utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine = INNODB
[client]
# 设置mysql客户端默认字符集
default-character-set = utf8
3、mysql5.7.10没有data目录,所以要初始化,如果datadir指向的data目录不存在,初始化的时候会新建
cmd> bin/mysqld --initialize-insecure --defaults-file=D:\JackGao\Downloads\mysql-5.7.10-winx64\my-default.ini
4、启动mysqld,并且修改root密码,关闭mysql直接关掉cmd窗口即可
cmd> mysqld --console
cmd> mysql -u root --skip-password
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED BY ‘123456‘;
5、安装mysqld服务,也可以不安装服务
cmd> cd /d D:\JackGao\Downloads\mysql-5.7.10-winx64\bin
cmd> mysqld -install mysql --defaults-file="D:\JackGao\Downloads\mysql-5.7.10-winx64\my-default.ini"
cmd> mysqld -remove mysql
启动mysql
cmd> net start mysql
关闭mysql
cmd> net stop mysql
安装结束
参考资料:
http://dev.mysql.com/doc/refman/5.7/en/data-directory-initialization-mysqld.html
-------------
The database must be initialized before MySQL can be started. For additional information about the initialization process, see Section 2.10.1.1, “Initializing the Data Directory Manually Using mysqld”.
To start the mysqld server from the command line, you should start a console window (or “DOS window”) and enter this command:
C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld"
The path to mysqld may vary depending on the install location of MySQL on your system.
You can stop the MySQL server by executing this command:
C:\> "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqladmin" -u root shutdown
-------------
2015-12-15T14:15:10.506825Z 0 [Note] InnoDB: not started
mysqld: Table ‘mysql.plugin‘ doesn‘t exist
2015-12-15T14:15:10.510825Z 0 [ERROR] Can‘t open the mysql.plugin table. Please run mysql_upgrade to create it.
2015-12-15T14:15:10.539827Z 0 [ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.user‘ doesn‘t exist
2015-12-15T14:15:10.540827Z 0 [ERROR] Aborting
shell> bin/mysqld --initialize (--console这个选项是把日志输出到命令行,否则就会把日志输出到datadir目录的xx.err文件中)
shell> bin/mysqld --initialize-insecure
Regardless of platform, use --initialize for “secure by default” installation (that is, including generation of a random initial root password). In this case, the password is marked as expired and you will need to choose a new one. With the --initialize-insecure option, no root password is generated; it is assumed that you will assign a password to the account in timely fashion before putting the server into production use.
-------------------------------
原文:http://995015196.blog.51cto.com/9324811/1723405
内容总结
以上是互联网集市为您收集整理的使用5个步骤完成在windows7下安装mysql-5.7.10-winx64.zip全部内容,希望文章能够帮你解决使用5个步骤完成在windows7下安装mysql-5.7.10-winx64.zip所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。