使用yum install mysql命令安装mysql无法找到mysql服务的解决办法

   前几天租了个阿里云的云服务器,想测试一下利用LNMP制作个人博客看能不能用,在装Mysql的时候发现启动不了Mysql。借助百度把这个问题给解决了

   首先我直接用yum install mysql*安装了所有关于mysql的东西,然后我就尝试用命令mysql去连接数据库,我查看mysql的状态发现就无法找到mysql服务

[root@izm5e5z2sx1y7auxdlj6x0z lib]# systemctl status mysql
Unit mysql.service could not be found.
[root@izm5e5z2sx1y7auxdlj6x0z lib]# 

  利用了度娘我才知道mysql和mariaDB的关系,具体看此博客https://www.cnblogs.com/kiik/p/centos7_mysql.html按照此博客说的把mariaDB的软件包全下一遍

mariadb-bench.x86_64 : MariaDB benchmark scripts and data
mariadb-devel.i686 : Files for development of MariaDB/MySQL applications
mariadb-devel.x86_64 : Files for development of MariaDB/MySQL applications
mariadb-embedded.i686 : MariaDB as an embeddable library
mariadb-embedded.x86_64 : MariaDB as an embeddable library
mariadb-embedded-devel.i686 : Development files for MariaDB as an embeddable library
mariadb-embedded-devel.x86_64 : Development files for MariaDB as an embeddable library
mariadb-libs.i686 : The shared libraries required for MariaDB/MySQL clients
mariadb-libs.x86_64 : The shared libraries required for MariaDB/MySQL clients
mariadb-server.x86_64 : The MariaDB server and related files
mariadb.x86_64 : A community developed branch of MySQL
mariadb-test.x86_64 : The test suite distributed with MariaD
percona-xtrabackup.x86_64 : Online backup for InnoDB/XtraDB in MySQL, Percona Server and
                          : MariaDB
nextcloud-mysql.noarch : MySQL database support for NextCloud
owncloud-mysql.noarch : MySQL database support for ownCloud

然后启动mariaDB服务,再使用mysql命令连接到数据库就ok了

[root@izm5e5z2sx1y7auxdlj6x0z lib]# systemctl start mariadb
[root@izm5e5z2sx1y7auxdlj6x0z lib]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> exit
Bye

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值