CentOS7 installing MySQL

Source: Internet
Author: User
Tags mysql in

MARIADB is installed by default in CentOS, this is the branch of MySQL, but in order to need, it is necessary to install MySQL in the system, and after the installation is complete, you can overwrite the mariadb directly.

1 Download and install the official MySQL Yum Repository
[Email protected] ~]# Wget-i-C http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

Use the command above to download the installation of Yum Repository, about 25KB, then you can directly install Yum.

[Email protected] ~]# yum-y install mysql57-community-release-el7-10.noarch.rpm

After that, the MySQL server starts to install.

[Email protected] ~]# yum-y install Mysql-community-server

This step may take some time, and the previous mariadb will be overwritten when the installation is complete.

Now that MySQL is installed, then there are some settings for MySQL.

2 MySQL Database settings

Start MySQL First

[Email protected] ~]# systemctl start  mysqld.service

View MySQL running status, running status

[Email protected] ~]# systemctl status Mysqld.service

At this point, MySQL has started to run normally, but to get into MySQL also need to find the root user's password, the following command can be found in the log file password:

[[email protected] ~]# grep "Password"/var/log/mysqld.log

Enter the database as follows:

[Email protected] ~]# mysql-uroot-p

Enter the initial password and you can't do anything at this time, because MySQL must change the password before you can manipulate the database:

Mysql> ALTER USER ' root ' @ ' localhost ' identified by ' new password ';


CentOS7 installing MySQL

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.