Lamp architecture and MYSQL_MARIADB introduction and MySQL Installation

Source: Internet
Author: User

First, lamp architecture introduction

LAMP is linux apache MySQL php shorthand, in fact, is the Apache, MySQL and PHP installed on the Linux system, to form an environment to run the PHP scripting language. Apache is the most commonly used Web services software, and MySQL is a relatively small database software, both software and PHP can be installed on the Windows machine.

1. Linux+apache (httpd) +mysql+php

2, three characters can be in a machine, can also be separated (httpd and PHP to be together)
3,httpd, PHP, MySQL three how to work

Reference Document:http://blog.csdn.net/zdp072/article/details/50583581

Second, MySQL and mariadb introduction

MYSQL/MARIADB Introduction

  • MySQL is a relational database, with MySQL AB developed, MySQL was acquired by Sun in 2008 (1 billion Knives), 2009 Sun Company was acquired by Oracle Company (7.4 billion knives)
  • MySQL official website https://www.mysql.com latest version 5.7GA/8.0DMR
  • MysSQL5.6 change relatively large, 5.7 performance has been greatly improved
  • MARIADB is a branch of MySQL, official website https://mariadb.com Latest Version 10.2
  • Mariadb mainly by Skysql Company (now renamed MARIADB Company) Maintenance, Skysql company by MySQL original author led most of the original squad founded
  • Mariadb5.5 version corresponds to MySQL 5.5, 10.0 corresponds to mysql5.6
  • Community Community Edition, Enterprise Business Edition, GA (generally Available) refers to the generic version, used in production environments, DMR (development Milestone release) development milestone release, RC (Release Candidate) Release Candidate version, beta Open beta version, alpha internal beta version
Third, the installation of MySQL

We usually install MySQL is the source package installed, but because it takes a long time to compile, it is recommended to install the binary-free compiler package. You can go to the official MySQL website to download http://dev.mysql.com/downloads/specific version according to your platform and requirements, currently more commonly used for the mysql5.6 version. (Note that the following installation steps are based on 64-bit operating systems, if your system is 32-bit, you need to download a 32-bit package)

uname -a        //查看系统版本
1. Download MySQL to/usr/local/src/
[[email protected] ~]# cd /usr/local/src[[email protected] src]# wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz^C
2. Decompression
[[email protected] src]# tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
3. Move the extracted data to/usr/local/mysql
[[email protected] src]# mv mysql-5.6.36-linux-glibc2.5-x86_64 /usr/local/mysql

4. Create a MySQL user
[[email protected] mysql]# useradd mysql
5. Create/data/directory, if existing, do not create (data file for MySQL)
[[email protected] mysql]# mkdir /data/
6. Initialize MySQL
[[email protected] mysql]# ./scripts/mysql_install_db --user=mysql --datadir=/data/mysql

--user defines the owner of the database, the--datadir defines where the database is installed, and it is recommended to place the partition on a large space, which needs to be created on its own.
When initializing, the following problems may occur:

The literal meaning is, lacks the Perl module, lacks the dumper support, then how solves?
Use fuzzy search to filter the key to try to solve:

[[email protected] mysql]# yum list | grep perl | grep -i dumper       //-i忽略大小写


After the search is complete, you can try each of the installation packages if you are unable to determine which installation package is required when the above four packages are installed.

[[email protected] mysql]# yum install -y perl-Data-Dumper.x86_64

After the installation is done, re-initialize MySQL:

a two OKappears, indicating that the installation was successful.

7. Copy the configuration file
[[email protected] mysql]# cp support-files/my-default.cnf /etc/my.cnfcp:是否覆盖"/etc/my.cnf"? y

8. Copy startup script file and Modify permissions
[[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysqld[[email protected] mysql]# chmod 755 /etc/init.d/mysqld

Then modify the startup file:

[[email protected] mysql]# vi /etc/init.d/mysqld

9. Add the startup script to the system service, set the boot up and start the MySQL
[[email protected] mysql]# chkconfig --add mysqld      //把mysqld服务加入到系统服务列表中[[email protected] mysql]# chkconfig mysqld on          //开机启动mysqld[[email protected] mysql]# service mysqld start           

If not, please check the error log under/data/mysql/, which is usually the hostname. Err.
The command to check if MySQL starts is:

[[email protected] mysql]# ps aux |grep mysqld

To view the listening port:

[[email protected] mysql]# ps aux |grep mysqld


Stop MySQL:

If no INIT.D startup script starts, it can be started with the command line:

[[email protected] mysql]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql &


Run as a command line, what other ways to turn it off?

The process must be killed with the Killall command, which is more secure.
The Killall command executes the program before it kills the process.
If Killall wait for a long time did not kill, indicating that the amount of data is very large, need to write to the disk after completion, slowly kill;
If forced to kill, it can result in data loss or damage to the table.

Lamp architecture and MYSQL_MARIADB introduction and MySQL Installation

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.