时隔半年,重装了系统的我又遇到了相同的问题,再补充一些需要注意的点
根据官方的提示:
Make a fresh installation of mysql when it hang "in service start..."
make this:
open with notepad++ the file my.ini file and to innodb section add this:
#*** INNODB Specific options ***
innodb_buffer_pool_size = 256M
innodb_log_file_size = 256M
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = normalSave the file, after
go a usually on windows
c:\ProgramData\MySQL\MySQL Server5.5\data and cancel this file:
DESKTOP-K1N1S7A.err
ib_logfile0
ib_logfile1
ibdata1Now you can resume the installation ad yoy see the service start.
Note, If the installation not continue... no problem, close ed remake the installation.
就是说需要做一些配置
我们在 C:\ProgramData\MySQL\MySQL Server 5.7\下找到 my.ini
用notpad++打开,或者其他专业工具,不要用记事本打开,会破坏配置文件格式,官方也说了用notpad++
ctrl+f 输入:#*** INNODB Specific options ***
在下面添加一下几列,注意格式
innodb_buffer_pool_size = 256M
innodb_log_file_size = 256M
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = normal
然后保存
此时可以将数据库安装界面关掉 了,然后window+r输入:services.msc 打开服务,找到mysql 点击启动
不出意外,报错
我们看看日志,发现很多类似报错Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
这个我猜测是数据库没有初始化,导致无法加载 启动mysql服务必须使用的表
在复制这个文件的时候,需要将Data下的文件全部删除掉,不然还是启动不起来的
这里应该有个命令 可以直接初始化,但是我忘记了,就用了个笨方法,找到可以正常启动mysql的电脑中的 C:\ProgramData\MySQL\MySQL Server 5.7\Data 这个目录下,把mysql这个文件夹复制到自己电脑的目录下面,然后在从服务启动,哎,好了
这里的启动,是windows+R 输入 “services.msc” 在弹出的服务列表中,输入法切换英文,按一下 M,会自动索引到Mysql服务附近,选中,点击启动就行。
这个 mysql的我已经共享了 链接:https://pan.baidu.com/s/1-w79AISEarQnnMlcSrgapA 提取码:fab6
没有网盘的访问csdn资源mysql5.7.17缺少初始化数据库.zip_mysql没有mysql库-MySQL文档类资源-优快云下载
别人的文章是参考的,还是要靠自己去解决问题。