Home >Database >Mysql Tutorial >What is the difference between installing mysql under centos7 and linux?
MySQL was installed for a day today, and it was finally installed after get off work in the evening. Various errors were reported all the time.
The reason why I keep reporting errors is actually because centos7 is just a series of linux, and linux is a large category. I searched for ways to install mysql through linux, and found many installation methods that were not suitable for me, mainly Reporting this error
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
In fact, when I saw this error, mysql had already been installed, but it was just caused by an access permission issue.
Just execute:
chown -R mysql:mysql /var/lib/mysql
Then restart and it will be ok.
The specific installation process is as follows
1. Download the yum source
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
2. Installation
sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm
After executing this step, the installation is actually completed. If you encounter the above For permission issues, just install my solution to solve it.
The above is the detailed content of What is the difference between installing mysql under centos7 and linux?. For more information, please follow other related articles on the PHP Chinese website!