win10安装mysql

文章描述了在安装mysql-5.7.39-winx64版本时遇到的基于my.ini配置文件的问题,特别是关于basedir的注释和errmsg.sys错误消息。此外,初始化数据阶段显示了多个警告,包括TLS版本过旧和自签名证书的使用。最后,提到了启动MySQL服务并修改root密码的步骤,以及将MySQL添加为服务的操作。
摘要由CSDN通过智能技术生成

1,安装版本:

mysql-5.7.39-winx64

2,my.ini文件:

basedir 必须注释掉,否会有错误:错误内容为:

Can't find error-message file 'D:\mysql\mysql\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive

my.ini文件内容:

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

3.1,初始化数据(注意目录)

2023-01-07T08:15:14.394296Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2023-01-07T08:15:14.576592Z 0 [Warning] InnoDB: New log files created, LSN=45790
2023-01-07T08:15:14.620302Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2023-01-07T08:15:14.709317Z 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: 69d90a5d-8e63-11ed-9236-98fa9bbcb275.
2023-01-07T08:15:14.713545Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2023-01-07T08:15:15.508274Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2023-01-07T08:15:15.508557Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2023-01-07T08:15:15.511399Z 0 [Warning] CA certificate ca.pem is self signed.
2023-01-07T08:15:15.784901Z 1 [Warning] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.

4,启动mysql,修改root密码

启动之前修改my.ini文件,注释掉最后一行:

# skip-grant-tables

启动命令(进入对应目录):

mysqld --console

5,添加mysql到服务(可不添加到服务

mysqld -install
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值