How to install and configure mysql 5.7.19 in centos6.5, centos6.55.7.19

Source: Internet
Author: User

How to install and configure mysql 5.7.19 in centos6.5, centos6.55.7.19

Centos6.5 detailed steps for installing mysql5.7.19 are as follows:

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

Groupadd mysql
Useradd mysql-g mysql

3. decompress the files to be installed to the specified directory,

You need to set the chown 755 directory to allow mysql access.

4. Find the bin in the decompressed mysql directory and find the mysqld executable file in the bin. Run

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

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

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

7. Set the mysql connection and connect 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

Set
Basedir =/home/mysql
Datadir =/home/mysql/data
User = mysql

9. start mysql with service mysql

10. When mysql-uroot is connected to mysql, the following prompt is displayed: root @ localhost is not allowed to log on. You need to set a password.

Disable mysql first

Modify/etc/my. cnf

Add skip-grant-tables to mysqld

Enable mysql

Enter

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

Modify the root password.

Or go to mysql> set password = password ('20140901 ');

11. Set the character type of the database

Edit/etc/my. cnf
Add in mysqld
Character-set-server = utf8
Add
Default-character-set = utf8

12. view the character type of the database

Mysql> show variables like "% character % ";

Highlights: mysql installation tutorials for different versions mysql5.7 installation tutorials for various versions mysql5.6 installation tutorials

The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.

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.