Personal encounters with problems:
I bought the cloud host one months ago, the UI picture is good, the front end is also written, PHP How to develop also think well, the result, the installation of Apache is successful, MySQL seems to be installed successfully, but MySQL simply can not run up, make me careless write code.
The details are as follows:
Use service mysqld start; Systemctl mysqld start; there is no use, always show no mysqld this service (MySQL is not),
When you use Mysql-uroot-p, it also shows that you cannot connect to the MySQL server via Mysql.sock.
I also saw countless posts, Google turned over, are useless, are no use, and then went to the library borrowed a book called "in-depth understanding of MySQL and mariadb" books, finally solved the problem. (/(ㄒoㄒ)/)
Reason:
Yes, you run the Yum install on Cento7 mysql install is mariadb (this is the MySQL original squad after MySQL company sold to other companies a few years later, to prevent MySQL from being the Oracle closed source new generation of a MySQL branch), Instead of the original MySQL.
In addition, so you run
Yum install MySQL is equivalent to running yum install MariaDB
But for MARIADB, the direct installation of MARIADB is not going to run as a service, because you only install MARIADB client, so you also need to download a series of MARIADB components than Mariadb-server (server side).
Workaround:
Run the yum Search all MariaDB
A series of packages are then listed
Mariadb-benchmariadb-develmariadb-embeddedmariadb-servermariadb-testmariadb-libs
Install these to solve the problem (can choose to install Oh, each package is introduced)
In addition, if you feel that I am not detailed, please refer to the Linux commune article:
CentOS 7.0 uses Yum to install MariaDB and MariaDB simple configuration
CentOS installs MARIADB (MySQL) through Yum and cannot start the service or find Mysql.sock
Why can't I find the MySQL service in CentOS7 and can't find Mysql.sock?