mysql-8.0.25-winx64免安装配置

mysql下载地址:点击跳转

1.安装:
在这里插入图片描述
2.解压和初始化:
在这里插入图片描述
(1)my.int配置:

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
 
[mysqld]
# 绑定IPv4
bind-address=0.0.0.0
# 设置端口号
port=3306
# 设置mysql的安装目录,即解压目录
basedir=D:\\study\\software\\mysql\\mysql-8.0.25-winx64
# 设置数据库的数据存放目录
datadir=D:\\study\\software\\mysql\\mysql-8.0.25-winx64\\data
# 设置允许最大连接数
max_connections=200
# 设置允许连接失败次数
max_connect_errors=10
# 设置服务端的默认字符集
character-set-server=utf8
# 创建表使用的默认存储引擎
default-storage-engine=INNODB
# 使用“mysql_native_password”插件认证
default_authentication_plugin=mysql_native_password

保存后退出

(2)初始化MYSQL配置
管理员身份进入bin下打开cmd:

进入cmd界面:
在这里插入图片描述
第一步:初始化mysql

mysqld --initialize --console

结果:

2021-06-05T10:43:19.268152Z 0 [System] [MY-013169] [Server] D:\study\software\mysql\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) initializing of server in progress as process 1528
2021-06-05T10:43:19.269414Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2021-06-05T10:43:19.283755Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-06-05T10:43:20.232918Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-06-05T10:43:22.439337Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Gu%icd/ve36h

记住随机密码:Gu%icd/ve36h

而且文件夹data被初始化

第二步:安装mysql服务

mysqld --install mysql --defaults-file="D:\study\software\mysql\mysql-8.0.25-winx64\my.ini"

结果:

Service successfully installed.

出现:不是内部或外部命令,也不是可运行的程序 或批处理文件。 需要提前配置mysql环境变量
配置环境变量:

第一步:
在这里插入图片描述
第二步:
在这里插入图片描述
(3)启动mysql服务:

net start mysql

结果:

mysql 服务正在启动 .
mysql 服务已经启动成功。

启动成功!

查看服务:
在这里插入图片描述

(4)登录mysql

mysql -uroot -p

密码为之前的随机密码::Gu%icd/ve36h

复制密码,后鼠标右键粘贴

D:\study\software\mysql\mysql-8.0.25-winx64\bin>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.25

Copyright (c) 2000, 2021, 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>

出现该结果即可以了

(5)修改密码

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';

结果:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Query OK, 0 rows affected (0.01 sec)

mysql>

(6)验证新密码

D:\study\software\mysql\mysql-8.0.25-winx64\bin>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.25 MySQL Community Server - GPL

Copyright (c) 2000, 2021, 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> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql>

3.其他命令:
(1)关闭服务

net stop mysql

(2)卸载服务

mysqld --remove

觉得有帮助不妨帮小弟点个赞吧,感谢各位参考本文,如有错误,还请各位不吝赐教!

声明:本文参考
https://www.cnblogs.com/dzhy/p/11055900.html
如有冒犯,还请谅解

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

嗝屁小孩纸

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值