CentOS 7 Installation MySQL Database

Source: Internet
Author: User
Tags mysql version

CentOS 7 Installation MySQL Database

1. Now that the installation package, MySQL installation package is divided into Community Edition and Enterprise Edition, and this article will record the community version of the MySQL installation process, download the MySQL version as follows:

Mysql-5.7.16-linux-glibc2.5-x86_64.tar

Unzip the package will get the following two compressed package (good trouble ...) )

Mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz
Mysql-test-5.7.16-linux-glibc2.5-x86_64.tar.gz

Here we only need to unzip the first compressed package, and then rename the unpacked compressed package to: MySQL, and then copy the folder to the/usr/local/directory;

2. Create the relevant user and file directory

Groupadd MySQL

Useradd-r-G MySQL MySQL (-r: Specify MySQL user as System user, no login required)

Modify/usr/local/mysql/Directory Permissions: (Enter directory: cd/usr/local/)

Chown-r MySQL mysql/

Chgrp-r MySQL mysql/

Create log directory and PID directory

Mkdir/var/log/mariadb

Mkdir/var/run/mariadb

And also modify the permissions for both directories, IBID. (/usr/local/mysql).

3. Initializing MySQL Database

Entry directory: Cd/usr/local/mysql/bin

./mysqld--user=mysql--basedir=/usr/local/mysql/--datadir=/usr/local/mysql/data/--initialize

After execution the following will appear, please record the last initial login password: j,+arkijr35-

A temporary password is generated for [email protected]: j,+arkijr35-

4. Start the service

Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql

Service MySQL Start

5. Problems encountered:

1): Service MySQL start failed

Failed to get Properties:access denied
Starting MySQL ... error! The server quit without updating PID file (/var/lib/mysql/localhost.pid).

Or

error! MySQL server PID file could not being found!
Starting MySQL ... error! The server quit without updating PID file (/var/lib/mysql/localhost.pid).

Workaround:

/usr/local/mysql/support-files/mysql.server restart

Or

Mv/etc/my.cnf/etc/my.cnf.bak

More content

6. Links

./mysql-u Root-p

mysql> SET PASSWORD = PASSWORD (' 123456 '); Change Password

7. Telnet

To open remote login permissions, please check the relevant content, for example:

GRANT all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION;

All root can be logged in remotely with a 123456 password.

CentOS 7 Installation MySQL Database

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.