Linux Yum installation MySQL5.6

Source: Internet
Author: User

1. Newly opened cloud server, need to detect whether the system comes with the installation of MySQL

# yum list installed | grep mysql

2. If you find a system that comes with MySQL, do it decisively

# yum -y remove mysql-libs.x86_64

3. Wherever you store files in the directory to execute, here to explain, because this MySQL source servers in the server abroad, so download speed will be relatively slow, fortunately mysql5.6 only 79M big, and mysql5.7 182M, so this is I do not want to install mysql5.7 reason

# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

4. Then execute this sentence and explain that this rpm is not a MySQL installation file, just two yum source files, executed after the/etc/yum.repos.d/ This directory has more Mysql-community-source.repo and Mysql-community.repo

rpm -ivh mysql-community-release-el6-5.noarch.rpm

5. At this time, you can use the Yum repolist mysql command to see if you already have MySQL installable files

all | grep mysql

6. Install the MySQL server command (yes):

# yum install mysql-community-server

7. After successful installation

# service mysqld start

8. Since MySQL has just been installed, the root password of MySQL is empty by default, so we need to log in in time with the root user of MySQL (first enter, no password), and change the password

update user set password=PASSWORD("这里输入root用户密码") where User=‘root‘;# flush privileges; 

9. Check if MySQL is self-booting and set the self-start command

# chkconfig --list | grep mysqld
# chkconfig mysqld on

10.mysql security settings (the system will ask you a few questions, can not understand the translation after the copy, basically all the way Yes):

  # mysql_secure_installation

11. Troubleshoot remote connection issues:

Mysql-u Root-ppassword//Enter the MySQL console

Mysql>use MySQL;

Mysql>update User Set host = '% ' where user = ' root '; This command can be skipped when executing an error

Mysql>flush privileges;

Mysql>select host, user from user; Check that '% ' is inserted into the database

Mysql>quit

This article turns from https://www.cnblogs.com/renjidong/p/7047396.html

Linux Yum installation MySQL5.6

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.