解决Mysql5.7.17在windows下安装启动时提⽰不成功问题
在机器上⾸次安装MySQL,
操作系统是win7
mysql 的安装⽂件是 zip 格式的,版本是5.7.17
mysql下载后安装中出现提示不到安装包解压之后,安装步骤是
1、⾸先个⽂件存放这些安装程序以及数据
假设是E:\\mysql
2、把解压的⽂件放在E:\\mysql下,并且新建个data⽂件夹
3、创建环境变量mysql 路径是E:\\mysql
添加到path 中 %MYSQL%\bin;
4、在解压的⽂件夹下有个my-default.ini
的⽂件,⾸先拷贝⼀份,重命名为my.ini
修改⽂件内容
只修改两⾏就⾏
basedir = E:\\mysql
datadir = E:\\mysql\\data
这两⾏原先是⽤#号注释掉的,
5、⽤系统管理员⾝份启动命令⾏
输⼊mysqld -install
这个是安装mysql 服务的
6、输⼊mysqld --initialize
这个是因为⾃动5.7.7版本之后,windows安装mysql通过zip解压的⽅式,不再包含data ⽂件夹,这个可以参考官⽹的介绍
如果没有data⽂件夹,则会在启动mysql服务的时候起不来,观察data⽂件夹下后缀名是.err的⽂件就可以发现,会报这么⼀些错误
MySQL: Table 'mysql.plugin' doesn't exist
2017-01-01T17:13:33.200113Z 0 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
2017-01-01T17:13:33.202113Z 0 [Note] Salting uuid generator variables, current_pid: 6908, server_start_time: 1483290810, bytes_sent: 0,
2017-01-01T17:13:33.237115Z 0 [Note] Generated uuid: '9fb87162-d045-11e6-b092-00ff173a9c42', server_start_time: 1483297718, bytes_sent: 114009376
2017-01-01T17:13:33.241115Z 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: 9fb87162-d045-11e6-b092-00ff173a9c42. 2017-01-01T17:13:33.248116Z 0 [Warning] Gtid table is not ready to be used. Table 'id_executed' cannot be opened.
2017-01-01T17:13:33.250116Z 0 [Warning] Failed to set up SSL because of the following SSL library
error: SSL context is not usable without certificate and private key
2017-01-01T17:13:33.254116Z 0 [Note] Server hostname (bind-address): '*'; port: 3306
2017-01-01T17:13:33.259116Z 0 [Note] IPv6 is available.
2017-01-01T17:13:33.260117Z 0 [Note] - '::' resolves to '::';
2017-01-01T17:13:33.261117Z 0 [Note] Server socket created on IP: '::'.
2017-01-01T17:13:33.266117Z 0 [Warning] Failed to open optimizer cost constant tables
2017-01-01T17:13:33.268117Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
2017-01-01T17:13:33.270117Z 0 [ERROR] Aborting
其实这是因为这些表⽰放在data⽂件夹下的,所以我们需要先执⾏命令mysqld -initialize在完成mysql 的初始化,这样的话,mysql会⾃动完成⼀些初始化的⼯作
7、启动服务net start mysql
以上所述是⼩编给⼤家介绍的解决Mysql5.7.17在windows下安装启动时提⽰不成功问题,希望对⼤家有所帮助,如果⼤家有任何疑问请给我留⾔,⼩编会及时回复⼤家的。在此
也⾮常感谢⼤家对⽹站的⽀持!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论