安装MySQL点击执行完,最后一步会有四个步骤,一个✓都不打,然后卡死 (win10)
首先声明,此方法不是通用方法,一般解决因为安装后MySQL服务无法启动的问题
1.先打开自己的安装目录下看看有没有my.ini文件,如果没有就到桌面新建一个txt文本,名字改为my.ini,里面的内容可复制本文最下方的,然后把这个文件复制到安装目录下
2.再打开自己的服务,win+s输入服务直接搜索就行.看看有没有MySQL的服务,
如果有就启动, 如果没有就以管理员身份打开命令提示符
3.然后进入MySQL的安装目录下的bin目录
cd C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
(我的在C盘)
4.然后在命令行输入 mysqld.exe –install 回车 显示
Service successfully installed
再输入 net start mysql 回车 显示正在启动 启动成功 (如果没效果就可以尝试卸载MySQL重装,也是可能成功的)
再打开自己的开始菜单,点击MySQL 5.5 Command Line Client
5.输入密码,回车 如果闪退, 就去安装目录下打开my.ini在mysqld下面添skip-grant-tables
6.再打开一次MySQL 5.5 Command Line Client
输入密码,回车 如果闪退,
打开MySQL 5.5 Command Line Client 不输密码 回车 再试一次 如果都没有用,那么本解决方案不适合你的问题
配置内容注意事项
安装路径和文件保存路径要改为自己的
my.ini 配置内容
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# "