mysql5 安装

下载mysql5

https://dev.mysql.com/downloads/mysql/5.7.html

解压后配置在bin目录下新建my.ini

[client]
port=3306
default-character-set=utf8

[mysqld] 
# 设置为自己MYSQL的安装目录 
basedir=E:\mysql-5.7.37-winx64
# 设置为MYSQL的数据目录 
datadir=E:\mysql-5.7.37-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#开启查询缓存
explicit_defaults_for_timestamp=true
skip-grant-tables
#默认引擎
default-storage-engine=InnoDB

bin目录下安装mysql服务

E:\mysql-5.7.37-winx64\bin>mysqld --install
Service successfully installed.

初始化

E:\mysql-5.7.37-winx64\bin>mysqld --initialize --user=mysql --console
2022-03-06T03:11:29.779648Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-03-06T03:11:30.245461Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-03-06T03:11:30.340438Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-03-06T03:11:30.433731Z 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: 1e83f839-9cfb-11ec-b4a7-b025aa276450.
2022-03-06T03:11:30.438899Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-03-06T03:11:33.411394Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-03-06T03:11:33.411780Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-03-06T03:11:33.418555Z 0 [Warning] CA certificate ca.pem is self signed.
2022-03-06T03:11:34.183312Z 1 [Note] A temporary password is generated for root@localhost: Xet:dujLB1go

启动服务

E:\mysql-5.7.37-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。

在这里插入图片描述

修改密码

E:\mysql-5.7.37-winx64\bin>mysql -u root -p
#密码为之前初始化生成密码
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.37

Copyright (c) 2000, 2022, 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> set password for 'root'@'localhost' = password('');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值