时间:2022-06-09来源:www.pcxitongcheng.com作者:电脑系统城
win11安装mysql8最新压缩包版,供大家参考,具体内容如下
1、下载mysql
2、解压
3、初始化数据库并安装启动服务
以管理员身份打开CMD命令控制台
cd c:/dbs/mysql-8.0.29/bin 进入mysql8.0.29目录
mysqld --initialize-insecure 初始化,会自动的在c:/dbs/mysql-8.0.29/data 建立目录
mysqld install 安装服务,服务名称为mysql
net start mysql 开启数据库服务
net stop mysql 关闭数据库服务
mysqld remove 卸载服务
如果要通过窗口查看服务,在运行中可以输入services.msc 打开服务窗口
4、登录服务器测试
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
C:\Users\webrx>cd \ C:\>cd dbs\mysql-8.0.29 C:\dbs\mysql-8.0.29>cd bin #登录本机 -hlocalhost -uroot -p空没有密码 -P3306 可以不写 C:\dbs\mysql-8.0.29\bin>mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.29 MySQL Community Server - GPL 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> select @@hostname,@@port,@@version,@@basedir,@@datadir,now(); + ------------+--------+-----------+----------------------+---------------------------+---------------------+ | @@hostname | @@port | @@version | @@basedir | @@datadir | now() | + ------------+--------+-----------+----------------------+---------------------------+---------------------+ | wp | 3306 | 8.0.29 | C:\dbs\mysql-8.0.29\ | C:\dbs\mysql-8.0.29\data\ | 2022-05-11 14:25:17 | + ------------+--------+-----------+----------------------+---------------------------+---------------------+ 1 row in set (0.00 sec) mysql> show databases; + --------------------+ | Database | + --------------------+ | information_schema | | mysql | | performance_schema | | sys | + --------------------+ 4 rows in set (0.02 sec) mysql> select host, user ,plugin from mysql. user ; + -----------+------------------+-----------------------+ | host | user | plugin | + -----------+------------------+-----------------------+ | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | caching_sha2_password | + -----------+------------------+-----------------------+ 4 rows in set (0.00 sec) mysql> create user admin identified with mysql_native_password by 'admin' ; Query OK, 0 rows affected (0.01 sec) mysql> grant all on *.* to admin; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges ; Query OK, 0 rows affected (0.00 sec) mysql> select host, user ,plugin from mysql. user ; + -----------+------------------+-----------------------+ | host | user | plugin | + -----------+------------------+-----------------------+ | % | admin | mysql_native_password | | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | caching_sha2_password | + -----------+------------------+-----------------------+ 5 rows in set (0.00 sec) |
5、使用sqlyog 连接mysql8.0.29
注意:低版本的sqlyog(13.1.1及以下)无法识别mysql新版本(5.7-8)的加密机制(caching_sha2_password)
必须使用admin用户(在步骤4中建立的使用旧加密机制(mysql_native_password)的用户)登录
以上就是本文的全部内容,希望对大家的学习有所帮助。
2023-10-30
windows上的mysql服务突然消失提示10061 Unkonwn error问题及解决方案2023-10-30
MySQL非常重要的日志bin log详解2023-10-30
详解MySQL事务日志redo log一、单表查询 1、排序 2、聚合函数 3、分组 4、limit 二、SQL约束 1、主键约束 2、非空约束 3、唯一约束 4、外键约束 5、默认值 三、多表查询 1、内连接 1)隐式内连接: 2)显式内连接: 2、外连接 1)左外连接 2)右外连接 四...
2023-10-30
Mysql删除表重复数据 表里存在唯一主键 没有主键时删除重复数据 Mysql删除表中重复数据并保留一条 准备一张表 用的是mysql8 大家自行更改 创建表并添加四条相同的数据...
2023-10-30