installing MySQL under CentOS

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.