Home  >  Article  >  Database  >  Detailed explanation of the installation and configuration of mysql 5.7.19 under centos6.5

Detailed explanation of the installation and configuration of mysql 5.7.19 under centos6.5

黄舟
黄舟Original
2017-07-24 15:48:451457browse

This article mainly introduces the installation and configuration method of mysql 5.7.19 under centos6.5 in detail, which has certain reference value. Interested friends can refer to it

centos6.5 installation mysql5 .7.19 detailed steps, the specific content is as follows

1. Download mysql5.7.19
2 from the oracle website. 2. Add the centos user group and user MySQL

  groupadd mysql
      useradd mysql -g mysql

3. The files that need to be installed are decompressed into the specified directory.

The chown 755 directory needs to be set, and the setting can allow mysql to access it.

4. Go to the decompressed mysql directory and find bin. There is the mysqld executable file in bin. Execute

./mysqld --user=mysql --basedir=/home/mysql/mysql-5.7.16-linux-glibc2.5-x86_64 --datadir=/home/mysql/data --initialize

5. Copy my-defalut.cnf in the support-files directory under the installation directory to /etc/my.cnf

6. Install Copy mysql.service in the support-files directory to /etc/init.d/mysqld

7. Set up the mysql connection and connect the mysql in the bin in the installation directory to /usr /local/bin

 ln -fs /home/mysql/mysql-5.7.16-linux-glibc2.5-x86_64/bin/mysql /usr/local/bin/mysql

8. Modify /etc/my.cnf

Settings

  basedir=/home/mysql
      datadir=/home/mysql/data
      user=mysql

9. service mysql start Start mysql

10. mysql -uroot Connect to mysql prompt root@localhost is not allowed to log in, you need to set a password

Close mysql first

Modify/etc/my.cnf

Add skip-grant-tables in mysqld

Enable mysql

Enter

mysql>UPDATE mysql.user SET authentication_string=password('123456') WHERE User='root' AND Host='localhost';

Just change the root password.

Or enter mysql> set password=password('123456');

11. Set the character type of the database

Edit /etc/ my.cnf
Add
to mysqld character-set-server=utf8
Add
to client default-character-set=utf8

##12. Check the character type of the database

mysql>show variables like "%character%";

The above is the detailed content of Detailed explanation of the installation and configuration of mysql 5.7.19 under centos6.5. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn