千家信息网

CentOS7安装调试Mysql数据库的步骤详解【实例】

发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,本实例要求下载并安装调试Mysql数据库。第一步:下载Mysql数据库安装所需的全部软件。我已提前下载好数据库软件,直接在服务器下载即可,如下:通过scp直接下载:[root@agt20 ~]# sc
千家信息网最后更新 2025年12月02日CentOS7安装调试Mysql数据库的步骤详解【实例】

本实例要求下载并安装调试Mysql数据库。

第一步:下载Mysql数据库安装所需的全部软件。

我已提前下载好数据库软件,直接在服务器下载即可,如下:

通过scp直接下载:

[root@agt20 ~]# scp root@192.168.122.10:/root/mysql* /root/

软件如下图:

[root@agt20 ~]# ls mysql-*mysql-5.7.17.tarmysql-community-client-5.7.17-1.el7.x86_64.rpmmysql-community-common-5.7.17-1.el7.x86_64.rpmmysql-community-devel-5.7.17-1.el7.x86_64.rpmmysql-community-embedded-5.7.17-1.el7.x86_64.rpmmysql-community-embedded-compat-5.7.17-1.el7.x86_64.rpmmysql-community-embedded-devel-5.7.17-1.el7.x86_64.rpmmysql-community-libs-5.7.17-1.el7.x86_64.rpmmysql-community-libs-compat-5.7.17-1.el7.x86_64.rpmmysql-community-minimal-debuginfo-5.7.17-1.el7.x86_64.rpmmysql-community-server-5.7.17-1.el7.x86_64.rpmmysql-community-test-5.7.17-1.el7.x86_64.rpm

第二步:通过yum进行安装,起服务器并查看

[root@agt20 ~]# yum -y install mysql-*.rpm[root@agt20 ~]# systemctl restart mysqld[root@agt20 ~]# systemctl enable mysqld[root@agt20 ~]# systemctl status mysqld.service \u25cf mysqld.service - MySQL ServerLoaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)Active: active (running) since \u4e8c 2019-10-15 11:29:11 CST; 1min 15s agoDocs: man:mysqld(8)http://dev.mysql.com/doc/refman/en/using-systemd.htmlMain PID: 31584 (mysqld)CGroup: /system.slice/mysqld.service\u2514\u250031584 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid...10\u6708 15 11:28:42 agt20.tedu.cn systemd[1]: Starting MySQL Server...10\u6708 15 11:29:11 agt20.tedu.cn systemd[1]: Started MySQL Server.[root@agt20 ~]#

第三步:连接MySQL服务器,修改密码;

1)查看初始密码

[root@agt20 ~]# grep -i 'password' /var/log/mysqld.log 2019-10-15T03:28:55.200931Z 1 [Note] A temporary password is generated for root@localhost: r3qhDysMrM)

2)使用初始密码连接mysql服务

[root@agt20 ~]# mysql -uroot -p'r3qhDysMrM)'mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 4Server version: 5.7.17Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.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.mysql>

3)重置数据库管理员roo本机登录密码

mysql> alter user root@localhost identified by 'Pwd@123...';Query OK, 0 rows affected (0.00 sec)

4)修改密码策略

mysql> set global validate_password_policy=0;Query OK, 0 rows affected (0.01 sec)mysql> set global validate_password_length=6;Query OK, 0 rows affected (0.00 sec)mysql> alter user root@localhost identified by 'pwd@123';Query OK, 0 rows affected (0.00 sec)

5)使用修改后的密码登录

[root@agt20 ~]# mysql -uroot -ppwd@123mysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.17 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.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.mysql>

至此Mysql数据库安装调试完成!!!!

总结

以上所述是小编给大家介绍的CentOS7安装调试Mysql数据库的步骤详解,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

数据 数据库 密码 服务 服务器 软件 帮助 登录 实例 步骤 出处 疑问 策略 管理员 网站 至此 本机 支持 管理 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 软件开发笔记本电脑 远程服务器管理方案 浪潮服务器没有硬盘自检 中信网络安全股 网络安全与管理的基本概念 网络 监控 视频服务器 宁夏服务器续保调试 广西同创网络技术有限公司 疫情网络安全趋势 德利金天津软件开发公司 沈阳小熊软件开发有限公司 谁担任了网络安全协调会 rust怎么创造自己的服务器 我的世界服务器推荐招募管理 登录器不显示服务器列表如何解决 查询数据库中的所有库 数据库主机中wa值很高 软件开发注册商标多少类 深圳市睿云网络技术有限公司 网络安全保障工作的通知 网络安全验证码生成及应用实验 剑侠情缘服务器连接失败怎么办 福建安卓软件开发价格 网络安全产品排版手帐 spss筛选完整数据库 中信集团网络安全公司 计算机网络技术女的学的多吗 解析标签数据添加到数据库 争渡读屏软件开发公司 ibm刀片式服务器价格
0