返回顶部
首页 > 资讯 > 数据库 >在 centos 上安装配置 MySQL8.0 教程
  • 687
分享到

在 centos 上安装配置 MySQL8.0 教程

centosmysql数据库 2023-08-17 14:08:48 687人浏览 薄情痞子
摘要

在 Centos7 上安装配置 Mysql8.0 教程 在 Centos 环境上的安装配置安装配置连接 在 Centos 环境上的安装配置 安装环境为:在 win11系统 -> virtualbox 虚拟机 -> cento

在 Centos 环境上的安装配置

安装环境为:在 win11系统 -> virtualbox 虚拟机 -> centos7.9 系统 -> mysql8.0
测试时间为:2023 年 05 月

安装

  1. 确定所要下载的版本:
$ uname -m# 输出 x86_64$ cat /etc/redhat-release# 输出 CentOS linux release 7.9.2009 (Core)
  1. 下载对应版本的 rpm 文件资源 Download MySQL Yum Repository

对应文件为:Red Hat Enterprise Linux 7 / oracle Linux 7 (Architecture Independent)

点击:浏览器 ->下载 -> 右键复制文件下载链接,安装 yum 资源:

下载链接为:https://repo.mysql.com//mysql80-commUnity-release-el7-7.noarch.rpm

$ rpm -ivh Https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
  1. 查看 MySQL 当前版本:
$ yum info mysql-community-server# 8.0.33
  1. 安装 MySQL:
$ yum -y install mysql-community-server

安装完成!

配置

  1. 启动 MySQL 服务:
$ systemctl start mysqld.service
  1. 查看 MySQL 运行状态:
$ systemctl status mysqld.service
  1. 获取 root 用户的密码:
$ grep "passWord" /var/log/mysqld.log
2023-05-10T01:41:41.632792Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: _ih4M9ogiXt%# 其中最后的 _ih4M9ogiXt% 就是密码
  1. 进入数据库
$ mysql -u root -p# 初始密码为之前获取的 _ih4M9ogiXt%
  1. 修改新的密码:
# 密码设置必须要大小写字母数字和特殊符号$ ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
  1. 重新进入数据库
$ mysql -u root -p# 使用修改过后的密码
Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 10Server version: 8.0.33 MySQL Community Server - GPLCopyright (c) 2000, 2023, Oracle and/or its affiliates.Oracle is a reGIStered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

配置完成!

连接

所使用的数据库管理软件为 Datagrip,亲测十分好用。

  1. 打开软件,调出配置界面:
    在这里插入图片描述
  2. 先配置 ssh 连接:
    在这里插入图片描述
    在这里插入图片描述
  3. 再进行常规连接:
    在这里插入图片描述
  4. 调出所有数据库,创建会话:
    在这里插入图片描述
    在这里插入图片描述
    连接完成!

来源地址:https://blog.csdn.net/qq_39547794/article/details/130560898

您可能感兴趣的文档:

--结束END--

本文标题: 在 centos 上安装配置 MySQL8.0 教程

本文链接: https://www.lsjlt.com/news/372997.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作