MySQL database installation (CentOS OS/tar.gz mode)

Source: Internet
Author: User

1. Upload the MySQL installation package "mysql-5.5.40-linux2.6-x86_64.tar.gz" to the deployment machine, any location;

2. Extract the MySQL installation package to the directory where it is located, with the following command:

tar -zxvf mysql-5.5. -linux2. 6-x86_64. tar. gz

3. Copy the extracted directory to the system's local software directory "/usr/local/", the command is as follows:

CP -RF mysql-5.5. -linux2. 6-x86_64  /usr/local/mysql

4. Add the MySQL user group and the MySQL user with the following command:

-r-g MySQL MySQL

5. Go to the directory where the MySQL software is installed and command the following:

Cd/usr/local/mysql

6. Modify the current directory owner for the newly created MySQL user, with the following command:

chown -R mysql:mysql./

7. Copy the default global boot parameter profile to the/etc directory with the following command:

CP ./SUPPORT-FILES/MY-MEDIUM.CNF  /etc/my.cnf

8. Execute the installation package with the script, install the database, the command is as follows:

./scripts/mysql_install_db--user=mysql

9. Modify the current directory owner to be the root user, the command is as follows:

chown -R root:root./

10. Modify the data directory owner to be a MySQL user with the following command:

chown -R mysql:mysql Data

This completes the database installation and is verified below.

11. Modify the/etc/my.cnf file. Modify the character set of the database and make it "case insensitive".

Add under [client]:

Default-character-set=utf8

[Mysqld] under Add:

character-set-server=Utf8lower_case_table_names=1

[MySQL] under Add:

Default-character-set=utf8

12. Start the MySQL database, note: It needs to be executed with root, the command is as follows:

sudo /usr/local/mysql/support-files/mysql.server start

To see if the MySQL process has started, the command is as follows:

PS -ef| grep MySQL

Displays the results as shown, indicating that the MySQL database started successfully:

13. Modify the password of the root user of the MySQL database, the initial password for root is empty by default, and the command is as follows:

' fill in the password here '

MySQL Database installation (CentOS OS/tar.gz mode)

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.