欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

mysql 8.0.13 安装配置方法图文教程

程序员文章站 2023-03-24 22:51:13
本文为大家分享了mysql 8.0.13 安装配置教程,供大家参考,具体内容如下 下载 下载 解压 解压之后没有my.ini文件(我的端口设置的3308),...

本文为大家分享了mysql 8.0.13 安装配置教程,供大家参考,具体内容如下

下载

下载

mysql 8.0.13 安装配置方法图文教程

解压

mysql 8.0.13 安装配置方法图文教程

解压之后没有my.ini文件(我的端口设置的3308),截图中是我增加的

[client]
port = 3308
default-character-set = utf8
 
[mysqld]
port = 3308
character_set_server = utf8
 
basedir=d:\mysql\mysql-8.0.13-winx64
datadir=d:\mysql\mysql-8.0.13-winx64\data
 
group_concat_max_len=20000
 
 
[winmysqladmin]
d:\mysql\mysql-8.0.13-winx64\bin\mysqld.exe

管理员命令行

在mysql安装目录的 bin 目录下执行命令:

mysqld --initialize --console

得到如下结果

d:\mysql\mysql-8.0.13-winx64\bin>mysqld --initialize --console
2018-10-24t05:32:45.732454z 0 [system] [my-013169] [server] d:\mysql\mysql-8.0.13-winx64\bin\mysqld.exe (mysqld 8.0.13) initializing of server in progress as process 43080
2018-10-24t05:32:45.870611z 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.
2018-10-24t05:33:14.879343z 5 [note] [my-010454] [server] a temporary password is generated for root@localhost: mmqp.yfcy5xy
2018-10-24t05:33:37.812581z 0 [system] [my-013170] [server] d:\mysql\mysql-8.0.13-winx64\bin\mysqld.exe (mysqld 8.0.13) initializing of server has completed
 
d:\mysql\mysql-8.0.13-winx64\bin>

看到有个警告,查了一下mysql建议使用utf8mb4

修改my.ini文件

[client]
port = 3308
default-character-set = utf8mb4 
 
[mysqld]
port = 3308
character-set-server = utf8mb4 
 
basedir=d:\mysql\mysql-8.0.13-winx64
datadir=d:\mysql\mysql-8.0.13-winx64\data
 
group_concat_max_len=20000
 
 
[winmysqladmin]
d:\mysql\mysql-8.0.13-winx64\bin\mysqld.exe

警告没有了

d:\mysql\mysql-8.0.13-winx64\bin>mysqld --initialize --console
2018-10-24t06:06:51.100372z 0 [system] [my-013169] [server] d:\mysql\mysql-8.0.13-winx64\bin\mysqld.exe (mysqld 8.0.13) initializing of server in progress as process 47804
2018-10-24t06:07:18.372699z 5 [note] [my-010454] [server] a temporary password is generated for root@localhost: nj>uujkph4/i
2018-10-24t06:07:36.024435z 0 [system] [my-013170] [server] d:\mysql\mysql-8.0.13-winx64\bin\mysqld.exe (mysqld 8.0.13) initializing of server has completed
 
d:\mysql\mysql-8.0.13-winx64\bin>

上面打印了默认密码:nj>uujkph4/i

安装服务

mysqld --install mysql8.0

因为这是电脑上第二个mysql 所以服务名改成了 mysql8.0

mysql 8.0.13 安装配置方法图文教程

启动服务

net start mysql8.0

mysql 8.0.13 安装配置方法图文教程

修改初始密码

登录mysql之后执行

alter user 'root'@'localhost' identified with mysql_native_password by '123456';

mysql 8.0.13 安装配置方法图文教程

精彩专题分享:

mysql不同版本安装教程

mysql5.7各版本安装教程

mysql5.6各版本安装教程

mysql8.0各版本安装教程

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。