Install Mysql step screenshot in Linux system _mysql

Source: Internet
Author: User
Tags mkdir

The following is the record of my work, the introduction of the Linux system using the official compiled binaries to install the MySQL installation process and installation of screenshots, this installation is fast, simple installation steps!

Need friends can follow the following steps to install, you can quickly install MySQL, hope to help everyone:)!

1, download MySQL Linux version of the binary installation package:

Address: http://dev.mysql.com/downloads/mysql/

Here I rename the installation package to: tingyun-mysql-5.6.22.tar.gz

Description: You can not rename the operation if you need to

2, Decompression installation package:

Unzip the installation package where you want to install: Execute the following command:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" "> Cd/opt
 tar–xpf tingyun-mysql-5.6.22.tar.gz</span>

The screenshot is as follows:

3, create MySQL installation directory, and modify directory permissions:

The following commands are executed:

Create MySQL directory: mkdir MySQL

Open MySQL directory: cd MySQL

Create data directory: mkdir data

Description: The data directory is created because the MySQL service process MYSQLD runtime accesses the data directory

In the MySQL directory, execute the following command: To set the owner of the directory as a MySQL user:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">chown mysql:mysql/opt/mysql–r</span>

The screenshot is as follows:

5, install MySQL

Execute the install command in the MySQL directory mysql_install_db:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">./scripts/mysql_install_db--user=mysql–datadir=/opt/mysql/data</span>

The screenshot is as follows:

6. Start MySQL

Enter INIT.D directory execution command:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">cd/etc/init.d/
mysqld restart</span>

If you do not want to reboot, you can start it manually, executing the following command:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">service mysqld start</span>

You can also execute the following commands directly under the MySQL directory:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">/etc/init.d/mysqld restart</span>

The screenshot is as follows:

7. Create soft links for MySQL

Execute the following command:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft Yahei" >ln–s/opt/mysql/bin/mysql/user/bin</span>

The screenshot is as follows:

8, modify the MySQL configuration

Perform the following command to edit:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">vim .bash_profile</span>

Description: Configure a directory using./mysql (such as the bin directory used./mysql)

(1) write at the bottom of the Bash_profile file

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">export path= $PATH:/usr/local/mysql/bin (your Installation bin directory) </span>

Execute: Wq command to save exit

(2) Execute the source command to make the system configuration effective:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">source/.bash_profile</span>

The screenshot is as follows:

9. Security Configuration Wizard

MySQL after the installation of the need to follow the security configuration of the MySQL security configuration thought:

Perform the following command to securely configure the root user of MySQL:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft Yahei" >mysql_secure_installation</span>

Set a new password select "Y" and enter the new password two times (the second time as a confirmation password).

Delete anonymous users, select "Y"

The screenshot is as follows:

You can also set a password for the root user by using the following methods:

Execute the following command:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft Yahei" >mysql–uroot–pnbs2o13</span>

The screenshot is as follows:

View the contents of the MySQL installation directory

The screenshot is as follows:

10, after the installation of MySQL test:

(1) To see if MySQL has been started:

Use either of the following three commands:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">netstat-tl | grep mysql
ps-aux | grep mysqld
netstat-lntup|grep 3306</span>

The MySQL-related process is printed on the screen and you see something like this:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">tcp 0 0 *:mysql *:* listen</span>

That MySQL has started successfully!

(2) To use MySQL, you need the following command to enter MySQL:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft yahei" ">mysql-u root-p</span>

(3) View version:

<span style= "FONT-SIZE:16PX; font-family: "Microsoft Yahei" ">select version ();</span>

The above is a small series to introduce you to the Linux installation of the MySQL steps to install the screenshot details, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

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.