Install MySql in Linux

Source: Internet
Author: User

This article mainly describes how to useSource codeTo install MYSQL:

Download the MySQL source code package and place it in/usr/local/src. Assume that my source code package is mysql.5.1.tar.gz.

 

Create a user group and a user

Groupadd MySQL // create a MySQL user group
Useradd-G MySQL // create a MySQL account

Start installation below:

1. decompress the source code package

Tar-zxvf mysql.5.1.tar.gz

2. Go to the extract package.

Install the software trilogy: Configure, make, make install

./Configure -- prefix =/usr/local/MySQL-with-charset = GBK

 

Make clean; make (where make clean can not be, it is best to bring it)

 

Make install

 

3. CP support-files/my-medium.cnf/etc/My. CNF // copy the my-medium.cnf file to the/etc/directory and rename it my. CNF

4. Open the my. CNF file in the editor, find the log-bin = mysql-bin line, and comment it out.

: # Log-bin = mysql-bin

5. Go to the installation directory:

Bin/mysql_install_db -- user = MySQL
6. Set Directory Permissions

Chown-r root. // Set directory permission attributes
Chown-r MySQL/usr/local/MySQL/var
Chgrp-r MySQL.
Bin/mysqld_safe -- user = MySQL & // start MySQL

 

 

7. Add/usr/local/MySQL/bin to the environment variable.

8. Run mysql-uroot. If the logon succeeds, the installation is successful.

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.