Windows10安装MySQL5.7.43

下载安装包
mysql-5.7.43-winx64.zip

解压到目录C:\Program Files\mysql-5.7.43-winx64,并在该目录中创建配置文件my.ini

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8

[mysqld]
# 设置3306端口
port = 3306 
# 设置mysql的安装目录
basedir=C:\Program Files\mysql-5.7.43-winx64
# 设置mysql数据库的数据的存放目录
datadir=C:\Program Files\mysql-5.7.43-winx64\data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

初始化数据库并生成临时密码

C:\Program Files\mysql-5.7.43-winx64\bin> .\mysqld.exe --initialize --console
2023-10-16T14:36:54.265391Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-10-16T14:36:54.598124Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-10-16T14:36:54.665754Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-10-16T14:36:54.743420Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 73d25052-6c31-11ee-b7a2-74d43510f3a8.
2023-10-16T14:36:54.753703Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-10-16T14:36:55.542757Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-10-16T14:36:55.547191Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-10-16T14:36:55.554480Z 0 [Warning] CA certificate ca.pem is self signed.
2023-10-16T14:36:55.804792Z 1 [Note] A temporary password is generated for root@localhost: eZ7iZBAsh_hk

安装MySQL服务

C:\Program Files\mysql-5.7.43-winx64\bin> .\mysqld.exe install
Service successfully installed.

启动MySQL服务

C:\Program Files\mysql-5.7.43-winx64\bin> net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

修改MySQL密码

C:\Program Files\mysql-5.7.43-winx64\bin> .\mysql.exe -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.43

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

设置开机启动
以管理员身份运行命令提示符

C:\Users\Administrator>sc config mysql start=auto
[SC] ChangeServiceConfig 成功
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
安装 MySQL 5.7.43 的 zip 版本,你可以按照以下步骤进行操作: 1. 访问 MySQL 官方网站 https://dev.mysql.com/downloads/mysql/,滚动页面找到 "MySQL Community Downloads" 部分。 2. 在 "MySQL Community Server" 中,选择 "MySQL Community Edition (GPL)"。 3. 在 "Select Operating System" 下拉菜单中,选择适用于你的操作系统的选项。然后点击 "Go" 按钮。 4. 在 "MySQL Community Server" 部分,找到 "MySQL Community Server 5.7.xx" 并点击对应的下载链接。 5. 在 "MySQL Community Server 5.7.xx" 页面中,向下滚动到 "Generally Available (GA) Releases" 部分。在这里你可以找到一个 zip 归档文件的下载链接。点击下载。 6. 下载完成后,解压缩 zip 文件到你想要安装 MySQL 的目录。 7. 进入解压缩后的目录,找到并打开一个名为 "my.ini" 的文件。在该文件中,你可以配置 MySQL 的一些参数,如端口号、字符集等。 8. 在解压缩的目录中找到 "bin" 文件夹,在该文件夹中运行命令提示符。 9. 在命令提示符中,输入以下命令启动 MySQL 服务: ``` mysqld --initialize-insecure ``` 10. 接着,输入以下命令启动 MySQL 服务器: ``` mysqld ``` 11. 此时,MySQL 服务器应该已经成功启动。你可以使用 MySQL 的命令行客户端或其他工具来连接和管理数据库。 注意:以上步骤仅适用于 Windows 系统。如果你使用的是其他操作系统,请访问 MySQL 官方文档以获取相应的安装指南。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值