MySQL installation under Linux

Source: Internet
Author: User

Overview: MySQL is popular for its light, open source, free features, and MySQL's wide range of usage data. In this paper, the installation of mysql-5.6.12 (*.tar.gz) in the CentOS environment is used as an example to record the details of installing MySQL under Linux for reference only.

1, download the specified version of the MySQL installation files (official website: http://mysql.com/downloads, you can also use wget), and then copy to, home.

2. Unzip the MySQL file

#cd/Home

#tar-ZXVF mysql-5.6.12-linux-glibc2.5-x86_64.tar.gz

Copy the MySQL file to/usr/local

#cp-rf/home/mysql-5.6.12-linux-glibc2.5-x86_64/usr/local/mysql5.6

3. Create MySQL groups and users

#groupadd MySQL

#useradd-G MySQL MySQL

4. Installation

Go to MySQL Directory

#cd/usr/local/mysql5.6

Initializing the database

#scripts/mysql_install_db--user=mysql

Modify the owner of a file

#chown Root.

Modify the owner of the Data folder

#chown-R MySQL Data

Change user groups

#chgrp-R MySQL.

Start MySQL

#cd/usr/local/mysql5.6

#bin/mysqld_safe--user=mysql &

5. Add MySQL to the system service

#cp-rf/usr/local/mysql5.6/support-files/mysql.server/etc/init.d/mysqld

#cd/etc/init.d/

#chkconfig--add mysqld

#chkconfig mysqld on

6. View MySQL Status

#service mysqld Status

7. Authorized Remote Access

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

FLUSH privileges;

8. Modify User Password

Update user Set Password = password (' 123456 ') where user = ' root ';

FLUSH privileges;

If you are reporting the error of can ' t connect to local MySQL server through socket '/tmp/mysql.sock ', check if there is a Mysql.sock file under TMP and authorize the file. Modify the My.cnf file below/usr/local/mysql and change the socket to/tmp/mysql.sock.

MySQL installation under Linux

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.