基本步骤:
- 下载安装包
- 解压配置my.ini
- 进入bin目录执行安装命令,安装mysql服务
- 启动mysql服务
- 登录mysql
- 设置mysql密码
1. 下载安装包
去官网下载或者百度网盘
mysql官网:https://www.mysql.com/downloads/
百度网盘:
链接:https://pan.baidu.com/s/1UHA-5Wz4bbR4U5YwA6nT2Q
提取码:9das
2. 配置my.ini
复制my-default.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-5.6.24-winx64"
datadir = "D:\mysql-5.6.24-winx64\data"
port = 3306
# server_id = .....
character-set-server=utf8
# 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
3. 安装mysql
启动cmd,以管理员方式运行,进入mysql解压后的bin目录,执行mysqld -install

4. 启动mysql服务
net start mysql
查看MySQL服务

5. 登录mysql
首次登录MySQL(安装完成默认是没有密码的,输入密码的时候直接回车,进入mysql)
mysql -u root -p

6. 设置mysql密码
因为前面已经登录mysql了,先exit;退出mysql,然后执行设置密码操作,比如设置密码为Qwer123456;输入设置密码指令之后会提示输入密码,因为默认密码是空,所以直接回车就行了。
mysqladmin -uroot -p password Qwer123456

使用新密码登录mysql


网友评论