临时写的一个小系统客户要求用mysql,所以下载一个来研究下。
解压后开始配置my.ini
配置my.ini
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
# 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=D:Program Filesmysql-5.7.13
datadir=D:Program Filesmysql-5.7.13data
tmpdir=D:Program Filesmysql-5.7.13data
port=3306
server_id=1234
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
sql-mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
explicit_defaults_for_timestamp=true
安装服务
用管理员身份打开cmd.exe,进到mysql的bin目录
D:Program Filesmysql-5.7.13in>mysqld install
Service successfully installed.
D:Program Filesmysql-5.7.13in>net start mysql
MySQL 服务正在启动 .
MySQL 服务无法启动。
服务没有报告任何错误。
请键入 NET HELPMSG 3534 以获得更多的帮助。
报错了,打开系统日志提示:
Fatal error: Can’t open and lock privilege tables: Table ‘mysql.user’ doesn’t existFor more information, see Help and Support Center at
原来新版的mysql需要启动服务前先执行初始化,如下:
D:Program Filesmysql-5.7.13in>mysqld --initialize
D:Program Filesmysql-5.7.13in>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
好了,我要开始切换到mysql数据库了。