使用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
发布了19 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/sandaawa/article/details/81239712