windows安装MYSQL5.7

windows安装MYSQL5.7

在Windows系统下安装MySQL 5.7的步骤如下:

步骤1:下载MySQL 5.7

  1. 打开浏览器并访问MySQL下载页面https://downloads.mysql.com/archives/community/
  2. 选择“Windows (x86, 64-bit), ZIP Archive”或“MySQL Installer for Windows”下载。当前版本是 mysql-5.7.44-winx64.zip
  3. 点击“Download”,在跳转页面中可以选择“No thanks, just start my download.”来直接下载。

步骤2:解压安装程序

  1. zip文件windows10以上操作系统可以直接解压 另外可以使用其他压缩工具解压

假定你解压的路径是 D:\mysql-5.7.44-winx64

步骤3:配置环境变量

  1. 右键点击“计算机”或“此电脑”,选择“属性”。
  2. 点击“高级系统设置”,然后点击“环境变量”。
  3. 新增一个环境变量 MYSQL_HOME=D:\mysql-5.7.44-winx64
  4. 在“系统变量”部分,找到并选中Path,点击“编辑”。
  5. 在“编辑环境变量”窗口中,点击“新建”,添加MySQL的bin目录路径。%MYSQL_HOME%\bin;
  6. 点击“确定”保存并退出所有窗口。

步骤4:新建配置文件 my.ini

MYSQL配置文件参考

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/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

[mysqld]
character-set-server=utf8
default-storage-engine=INNODB
#lower_case_table_names=1
log_bin_trust_function_creators=1
# 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.7.44-winx64
 datadir = D:\mysql-5.7.44-winx64\data
 port = 3306
 character-set-server=utf8
 character-set-filesystem = utf8
# 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 

步骤5:安装MYSQL

  1. 打开命令提示符(按Win+R,输入cmd并回车)。
  2. 输入以下命令连接到MySQL服务器:
mysqld --initialize --user=mysql --console

# 安装
mysqld --install mysql

# 卸载
mysqld -remove

# 启动服务
net start mysql
  
# 停止服务
net stop mysql
  
  1. 命令行进入 mysql -u root -p
  2. 成功连接后,修改密码:
mysql>update mysql.user set authentication_string=password('123456') where user='root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
mysql> flush privileges;

结束

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Jack_software

感谢打赏,我努力提供优质内容~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值