LAMP+LNMP (ii) MYSQL/MARIADB Overview and installation Practice

Source: Internet
Author: User

I. Overview of MYSQL/MARIADB

MySQL was developed by my SQL company in 1995, the relational database management software, MySQL development several times after the version replacement, the latest is 5.7ga/8.0dmr,my SQL company itself has also experienced two acquisitions, first was acquired by Sun, and then acquired by Oracle, So now MySQL belongs to Oracle's commercial software.

In 2009, one of MySQL's original authors and some MySQL developers developed the MARIADB. of which Mariadb5.5 corresponded the mysql5.5,10.0 corresponded to 5.6.

MARIADB itself is Google, Mozilla, and Wikimedia Foundation. Use.

Second, MySQL installation

There are three ways to install MySQL, Mariadb, Mangodb, Nagios, etc. business software, yum (RPM package), source installation (that is, install to make Binary free install package (equivalent to a green package under Windows). Here we will learn to install the binary compiler-free package for MySQL, which is recommended in practical work.

1. First, we need to download the MySQL binary package

CD USR/LOCAL/SRC
wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz

Here we review the path knowledge
/USR system-level application directory, you can equate to the c:/windows/directory under Windows, General Yum installed program will be dropped here (DAO ' Kao ' Zheng).
/usr/

2. Unzip the package

Tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz

3, put the Unpacked program folder into the/usr/local/path, and change the name mysql/

Mv-v mysql-5.6.36-linux-glibc2.5-x86_64//usr/local/mysql

Note that this step after the CD to this directory to see if there is a relevant sub-folder, sometimes the MySQL folder may already exist, you will be the MV, just extracted from the east to all the files, and so on the experiment will be wrong.

4. Create a MySQL user and/data/directory in the system

Useradd MySQL
mkdir/data/

5. Set MySQL user and path

./scripts/mysql_install_db--user=mysql--datadir=/data/mysql/

There will be errors when performing this step,

Here's how to add error handling
A, use the Yum command to see if there are any RPM packages that provide the above program

Yum List | grep Perl |grep-i dumper


B, Bing, Google search previous solutions.

C, here we need to install the first package "perl-data-dumper.x86_64"

Yum Install-y perl-data-dumper.x86_64

And then we'll execute the SET command.

Or a mistake.

./scripts/mysql_install_db--user=mysql--datadir=/data/mysql/


Here is the missing Libaio library file

A, look again.

Yum List |grep Libaio

b, put the packaging on the

Yum Install-y libaio*

And then we'll execute the SET command.

./scripts/mysql_install_db--user=mysql--datadir=/data/mysql

Start jumping a lot of characters. To install for half a minute.
Remember the echo $ when installing httpd in the front?

echo $?

Execute the echo $ command immediately after executing the last set command, and the return value is 0 OK.

6. Configure the MySQL configuration file

CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF

7. Start and close MySQL

Third, MARIADB installation

1, download the MARIADB source package

Cd/usr/local/src #依旧在该目录下操作, it is recommended that the binary compilation package of the downloaded program be put here
wget http://mirrors.neusoft.edu.cn/mariadb//mariadb-10.2.13/bintar-linux-glibc_214-x86_64/ Mariadb-10.2.13-linux-glibc_214-x86_64.tar.gz #国内大学的mariadb镜像, faster than direct to the official website.

2. Unzip the source package

Tar zxvf mariadb-10.2.13-linux-glibc_214-x86_64.tar.gzip

3. Move the compressed package to/usr/local/and rename it to MySQL

MV mariadb-10.2.13-linux-glibc_214-x86_64//usr/local/mysql
cd/usr/local/mysql/

4.

LAMP+LNMP (ii) MYSQL/MARIADB Overview and installation Practice

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.