Introduction to Lamp architecture, MySQL and mariadb introduction, MySQL Installation

Source: Internet
Author: User

Lamp Architecture Introduction

LAMP is a shorthand for Linux Apache MySQL PHP, which is to put Apache, MySQL, and PHP on a Linux system to form an environment to run PHP's 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.

MySQL and mariadb introduction
MySQL是一个关系型数据库,有mysql ab公司开发,mysql在2008年被sun公司收购(10亿刀),2009年sun公司被Oracle公司收购(74亿刀)MySQL官网https://www.mysql.com 最新版本5.7GA/8.0DMRMysSQL5.6变化比较大,5.7性能上有很大提升Mariadb为MySQL的一个分支,官网https://mariadb.com 最新版本10.2MariaDB主要由SkySQL公司(现更名为MariaDB公司)维护,SkySQL公司由MySQL原作者带领大部分原班人马创立Mariadb5.5版本对应mysql的5.5 ,10.0对应mysql5.6Community 社区版本,Enterprise 企业版,GA(Generally Available)指通用版本,在生产环境中用的,DMR(Development Milestone Release)开发里程碑发布版,RC(Release Candidate)发行候选版本,Beta开放测试版本,Alpha内部测试版本
MySQL Database installation

MySQL database as far as possible to the database official website to download

Operating system version

[Email protected] ~]# uname-a
Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon June 12:09:22 UTC x86_64 x86_64 x86_64 gnu/linux

Database version

mysql-5,6

Get connections

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

1. Download the MySQL database to the system

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

2. Unzip the

[Email protected] src]# tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz

3. File transfer

[Email protected] src]# MV Mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/mysql
[Email protected] src]# cd/usr/local/mysql/
[Email protected] mysql]# pwd
/usr/local/mysql
[Email protected] mysql]#

4. Create MySQL user and/data/directory data directory is used to store the database, generally in the production environment data is a single hard disk,

/usr/local/mysql
[[email protected] mysql]# useradd MySQL
[[Email protected] mysql]# CD/
[Email protected]/]# mkdir/data/
[Email protected]/]# ls/data/
[Email protected]/]#

5. Initializing MySQL Database
[[email protected] mysql]#./scripts/mysql_install_db--user=mysql--datadir=/data/mysqlfatal error:please Install the following Perl modules before executing./scripts/mysql_install_db:data::D umper[[email protected] mysql]# PS: Initialization of the database when prompted missing plug-ins, the following use fuzzy query, there are four installation packages installed each. [[email protected] mysql]# Yum List | grep Perl | Grep-i dumperrepository Epel is listed more than once in the Configurationrepository Epel-debuginfo are listed more than O                     nCE in the Configurationrepository Epel-source are listed more than once in the configurationperl-data-dumper.x86_64 2.145-3.EL7 Base Perl-data-dumper-concise.noarch 1.200-2.el6 E                      PEL Perl-data-dumper-names.noarch 0.03-17.el6 Epel Perl-xml-dumper.noarch 0.81-17.EL7 base [[email protected] mysql]# [[email protected] mysql]# yum Install -y perl-data-dumper.x86_64^c Install plug-in [[Email protecteD] mysql]#./scripts/mysql_install_db--user=mysql--datadir=/data/mysql^c Initialize the database, and at the last two OK can be expressed as initialization success 
6, copy the configuration file

[email protected] mysql]# CP support-files/my-default.cnf/etc/my.cnf

[Email protected] mysql]# VI/ETC/MY.CNF
Modify the configuration file contents, such as

7. Copy the startup script and modify the permissions

[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld
Copy boot file
[Email protected] mysql]# chmod 755/etc/init.d/mysqld
Modify Permissions
[Email protected] mysql]# Vi/etc/init.d/mysqld
[Email protected] mysql]#
Basedir=/usr/local/mysql
Datadir=/data/mysql
Edit the file and find Basedir and DataDir to add content to save the exit

8. Add the startup script to the system service entry, set boot up and start Mysql

[[email protected] mysql]# chkconfig--add mysqld//Add the MYSQLD service to the System Services list
[[email protected] mysql]# chkconfig mysqld on//boot start mysqld
[[Email protected] mysql]# service mysqld start//Start mysqld
Starting mysql.logging to '/data/mysql/zlinux.err '.
. success!
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
.

Introduction to Lamp architecture, MySQL and mariadb introduction, MySQL Installation

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.