Home > Database > Mysql Tutorial > Sharing the steps to install MySQL on Linux (binary distribution version) (pictures and text)

Sharing the steps to install MySQL on Linux (binary distribution version) (pictures and text)

黄舟
Release: 2017-03-28 13:46:49
Original
1367 people have browsed it

This article mainly introduces the Linux installation MySQL tutorial in detail, the binary distribution version, which has certain reference value. Interested friends can refer to this tutorial

The detailed steps for installing MySQL on Linux are shared with you for your reference. The specific content is as follows

Step one:

Download the MySQL installation package

Enter the mysql official website, enter the download interface, and select the version and operating platform you need. My computer is Centos 7. I choose linux Generic as the operating system and the latest version. (I think it should be OK to choose the Red Hat system, because CentOS is almost the same as Red Hat)

You can download it locally in the windows environment, Then copy it to the linux directory, and here I use the following command to download directly under linux

[root@hhh ~]# wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz
Copy after login

After the download is completed, it will display like this:

--2017-02-14 10:25:28-- https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz
正在解析主机 cdn.mysql.com (cdn.mysql.com)... 104.124.241.153
正在连接 cdn.mysql.com (cdn.mysql.com)|104.124.241.153|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:641555814 (612M) [application/x-tar-gz]
正在保存至: “mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz”

100%[=============================================>] 641,555,814 865KB/s 用时 14m 36s

2017-02-14 10:40:07 (715 KB/s) - 已保存 “mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz” [641555814/641555814])
Copy after login

After downloading, download from the current folder directory and move the installation package to your home directory. In this way, you can see the downloaded installation package in your home directory.

[root@hhh hhh]# ls
a.out   Documents mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz Templates
ctest   Downloads Pictures                  Videos
c_test.c Hello7   Public
Desktop  Music   Python-3.4.3
Copy after login

The second step:

Create user groups and users, and unzip the installation package

[root@hhh hhh]# groupadd mysql //创建Mysql用户组
[root@hhh hhh]# useradd -g mysql mysql  //创建系统用户mysql并将其加入到用户组mysql中
[root@hhh hhh]# tar xzvf mysql-5.7.16-linux-glibc2.5-x86_64.tar.gz //解压压缩包
Copy after login

The third step:

Create a symbolic link

After running the decompression command, we also need to create a mysql symbolic link created by tar in the /usr/local/path .

[root@hhh hhh]#ln -s /home/markpain/mysql-5.7.16-linux-glibc2.5-x86_64 /usr/local/mysql
Copy after login

The above command creates a link to /home/markpain/mysql-5.7.16-linux-glibc2.5-x86_64 /usr/local/mysql, mysql-5.7.16-linux-glibc2. 5-x86_64 is the real name of the subdirectory created by tar in the /usr/local/ directory. This link is necessary because the default installation path of MySQL is /usr/local/mysql and the default data directory is /usr/local/mysql/data.

It is worth noting that some MySQL versions use a different directory as the default installation directory, so it is very important to refer to the MySQL online documentation.

So far, MySQL has been basically installed.

The above is the detailed content of Sharing the steps to install MySQL on Linux (binary distribution version) (pictures and text). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template