Install mysql in linux

Source: Internet
Author: User

Install mysql in linux

1. mysql tar file download:

Https://dev.mysql.com/downloads/mysql/5.6.html#downloads

2. Enter the directory where the installation package is located

Run the following command:tar mysql-5.6.17-linux-glibc2.5-i686.tar.gz

3. Copy the decompressed mysql directory to the local Software Directory of the system:

Run the following command:cp mysql-5.6.17-linux-glibc2.5-i686 /usr/local/mysql -r

4. Add the mysql group and mysql users:

Run the following command:Groupadd mysql and useradd-r-g mysql

5. Install the database:

Go to the mysql installation directory and run the following command:cd /usr/local/mysql

Modify the current directory owner as a mysql user: Execute the commandchown -R mysql:mysql ./

Install the database: Execute the command ./scripts/mysql_install_db --user=mysql

Modify the current directory owner as root user: Execute the commandchown -R root:root ./

Modify the current data directory owner as a mysql user: Execute the commandchown -R mysql:mysql data

6. Start the mysql service and add and start the mysql service:

Add boot start: Execute the commandcp support-files/mysql.server /etc/init.d/mysql, Put the startup script in the boot initialization directory

Start mysql service: execute commandsservice mysql start

Run the following command:ps -ef|grep mysql The mysql service is successfully started.

7. Modify the mysql root User password. If the root initial password is empty:

Run the following command:./Bin/mysqladmin-u root password 'Password'

8. Place the mysql client in the default path:

ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql

Note: We recommend that you use soft links instead of directly copying package files to facilitate system installation of multiple versions of mysql.

Summary

The above section describes how to install mysql in linux. I hope it will help you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!

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.