Installed on CentOS today, there's a little problem with MySQL. Record the solution:
1: Troubleshooting yum Install Mysql-server no packages available
sudo yum install Mysql-server
Show:
Loaded plugins: Fastestmirror, LangPacks
Loading mirror speeds from cached hostfile
* base:mirrors.163.com
* extras:mirrors.163.com
* updates:centos.ustc.edu.cn
No packages available mysql-server.
Error: No processing required
Workaround :
Input command wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Show:
--http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
Parsing host repo.mysql.com (repo.mysql.com) ... 23.4.241.142
Connecting repo.mysql.com (repo.mysql.com) |23.4.241.142|:80 ... is connected.
An HTTP request has been made and is waiting for a response ... OK
Length: 6140 (6.0K) [Application/x-redhat-package-manager]
Saving to: "mysql-community-release-el7-5.noarch.rpm"
100%[======================================>] 6,140--.-k/s spents 0s
(467 MB/s)-Saved "mysql-community-release-el7-5.noarch.rpm" [6140/6140])
# ls
mysql-community-release-el7-5.noarch.rpm
# RPM-IVH mysql-community-release-el7-5.noarch.rpm in preparation ... ################################# [100%]
Upgrading/installing ...
1:mysql-community-release-el7-5 ################################# [100%]
Re-enter Yum install Mysql-server
2: Fix MySQL Cannot connect remotely problem:
After the computer is logged in to MySQL, change the "host" entry in the "User" table in the "MySQL" database, changing from "localhost" to "%".
Mysql>update User Set host = '% ' where user = ' root ';
Modify the host value (add the hostname/IP address as the wildcard%), or you can add a specific one directly, if error 1062 (23000) occurs when you execute the UPDATE statement : Duplicate entry '%-root ' for key ' PRIMARY ' error, requires select host from user where user = ' root ';
Check to see if the host already has a% value, and if you have the flush privileges directly below it, you can
Mysql>flush privileges;
installing MySQL under CentOS