解压出下载的文件mysql-5.6.24-win32.zip(有x86和x64两个版本)到任一目录,防止出现未知问题,最好放在非系统盘的非中文目录下,我的位置D:\mysql。打开文件夹复制一份my-default.ini为my.ini的配置文件。
配置文件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.
[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:\mysql"
datadir = "D:\mysql\data"
port = 3306
# 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
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#服务端的编码方式
character-set-server=utf8
[client]
#客户端编码方式,最好和服务端保存一致
loose-default-character-set = utf8
[WinMySQLadmin]
Server = "D:\mysql\bin\mysqld.exe"
************************************************
安装MYSQL:
开始——运行——cmd,然后cd到mysql安装目录的bin下面,我的目录就是“D:\mysql\bin”,然后执行mysqld -install,提示服务安装成功!
设置root密码:
由于一开始root密码是空的,所以第一次可以这样设置密码,代码:
mysqladmin -u root -p password 123456
输入以上代码后按回车,提示输入密码,因为原来root为空的,所以这里直接按回画即可。
删除MYSQL:
mysqld --remove
-----------------------------------------------------------------------
注:以上操作均在mysql安装目录的bin目录下进行。
-----------------------------------------------------------------------
MYSQL启动或停止:
开始->运行->cmd
停止:net stop mysql
启动:net start mysql
前提MYSQL已经安装为windows服务
上一篇:数据库 CHECKDB 发现了x个分配错误和 x 个一致性错误
下一篇:MYSQL:Got error 175 from storage engine 数据库提示错误,需要修复
讨论数量:1
打开命令窗口切换到mysql的bin目录下。
1.注册服务: