MYSQL:mysql-8.0.27-winx64.zip安装mysql-8.0.27-winx64.zip 安装
⼀、预备⼯作
2、下载版本:mysql-8.0.27-winx64.zip(⼤⼩:209.4MB;不是debug版本);
⼆、mysql数据库的安装
1、建⽴mysql的安装⽬录:D:\tools\db\mysql8027
2、建⽴数据存放⽂件夹:D:\tools\db\mysql_data
3、将“mysql-8.0.27-winx64.zip”,解压⾄ “D:\tools\db\mysql8027”
4、增加“系统环境变量”:path=D:\tools\db\mysql8027\bin
5、配置⽂件:my.ini(D:\tools\db\mysql8027)
[mysqld]
basedir=D:/tools/db/mysql8027
datadir=D:/tools/db/mysql_data
default_authentication_plugin=mysql_native_password
6、开启cmd命令;
7、数据库初始化:
C:\Users\Administrator>mysqld --initialize --console
2021-11-03T16:20:32.125572Z 0 [System] [MY-013169] [Server] D:\tools\db\mysql8027\ (mysqld
8.0.27) initializing of server in progress as process 9628
2021-11-03T16:20:33.760967Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-11-03T16:20:42.238252Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-11-03T16:21:00.148851Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-11-03T16:21:00.151989Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-11-03T16:21:01.518820Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: reLLh;Cr*3GD //初始化密码
C:\Users\Administrator>
8、安装服务:mysql
C:\Users\Administrator>mysqld --install [服务名]
C:\Users\Administrator>mysqld --install mysql
9、启动mysql服务:
C:\Users\Administrator>net start mysql
10、⽤初始化密码登录mysql数据库:
C:\Users\Administrator>mysql -uroot -pmysql下载之后是个文件夹
Enter password: (初始密码)reLLh;Cr*3GD
11、修改密码:
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '新密码';
12、常⽤的语句:
-- 权限查询:select user, host, authentication_string from mysql.user;
-- 建⽴新⽤户:create user 'admin'@'localhost' identified with mysql_native_password by 'xx';
-- 授权新⽤户: grant all on *.* to 'admin'@'localhost' with grant option;
三、数据库卸载:
1、停⽌mysql服务:
C:\Users\Administrator>net stop mysql
2、移除mysql服务:
C:\Users\Administrator>mysqld --remove
3、删除安装位置的⽂件夹:
删除⽂件夹:D:\tools\db\mysql8027
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论