如何安装mysql8版本?

一、下载

(1)点击https://dev.mysql.com/downloads/mysql/进入mysql官网下载页面

 

下载过程会非常慢,我们可以下载迅雷,然后复制下载链接让迅雷帮忙下载。

二、配置

解压后目录结构大概是这样

记住这个文件夹bin路径:我的是d:\mysqls\m8\bin

然后返回桌面 以管理员运行cmd,一定要是管理员形式,要不然会提示权限不足。

然后根据cmd命令行 一步一步找到刚才的bin目录。

 这个是步骤,具体就是四步

第一步:初始化data目录

第二步:安装mysql8服务

第三步:开启mysql8服务

第四步:初始化登录

# 初始化数据库,建立data目录
C:\dbs\m8\bin>mysqld --initialize-insecure

# 安装服务 wm8
C:\dbs\m8\bin>mysqld --install wm8
Service successfully installed.

# 启动服务 wm8
C:\dbs\m8\bin>net start wm8
wm8 服务正在启动 .
wm8 服务已经启动成功。


# 使用mysql -uroot 登录服务
C:\dbs\m8\bin>mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.1.0 MySQL Community Server - GPL

Copyright (c) 2000, 2023, 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 @@version();
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '()' at line 1
mysql> select @@version;
+-----------+
| @@version |
+-----------+
| 8.1.0     |
+-----------+
1 row in set (0.00 sec)

mysql> select @@version,@@port,@@basedir,@@datadir;
+-----------+--------+------------+-----------------+
| @@version | @@port | @@basedir  | @@datadir       |
+-----------+--------+------------+-----------------+
| 8.1.0     |   3306 | C:\dbs\m8\ | C:\dbs\m8\data\ |
+-----------+--------+------------+-----------------+
1 row in set (0.00 sec)

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2023-08-02 10:56:23 |
+---------------------+
1 row in set (0.00 sec)

三、验证是否安装成功mysql8

打开navicat 点击测试,显示连接成功就是成功安装了mysql8

 

  • 44
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

今天的接口写完了吗?

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

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

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

打赏作者

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

抵扣说明:

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

余额充值