一.问题描述
虚拟机win7 32系统安装mysql,配置好环境变量后启动mysql报错,提示mysql无法启动
通过mysqld --console命令查看报错信息,有3条error信息

二.问题解决
试了网上很多方法都没用,最后看到一篇文章:
http://www.manongjc.com/article/582.html
猜测是因为我手动的创建了data文件夹和my.ini配置文件

于是我把data文件夹和配置文件删除,然后执行命令进行初始化:

可以看到生成了data文件夹,里面含有之前没有的一些文件比如mysql文件夹

又手动创建了my.ini文件,
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
#skip-grant-tables
character-set-server=utf8
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir = C:/c1/develop/mysql/mysql-5.7.35-win32
datadir = C:/c1/develop/mysql/mysql-5.7.35-win32/data
# port = .....
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
# 允许最大连接数
max_connections=200
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
最后再次启动mysql服务,可以成功启动了


在Win7 32位虚拟机上安装MySQL后,启动时遇到错误,提示'user'和'plugin'表不存在。通过mysqld --console获取错误详情,尝试多种网上的解决方案无效。最终解决方法是删除手动创建的data文件夹和my.ini配置文件,重新初始化MySQL,然后手动创建my.ini文件,最终成功启动MySQL服务。
6万+






