Introduction to lamp architecture; MySQL installation (upper and lower)

Source: Internet
Author: User


11.1 Lamp Architecture Introduction

1. Lamp includes:Linux+Apache(httpd)+MySQl+ PHP

Linux : Operating System (CentOS)

Apache : httpd--external Service software

MySQl : Store data Software (string)

PHP : scripting language (for website-based)

2. (httpd) , , php These three characters can be installed on the same machine, or can be used separately. (Note: and to be together)

3.


11.2 mysql_mariadb Introduction

1.


Extended:

mysql5.5 source code Compilation installation http://www.aminglinux.com/bbs/thread-1059-1-1.html

mysql5.7 binary package installation (large variation) http://www.apelearn.com/bbs/thread-10105-1-1.html

11.3 MySQL installation (top)

To Install the download tool: yum-y Install wget

1. go to the download installation package directory:

[email protected] ~]# cd/usr/local/src/

2. Download the mysql installation package :

[email protected] src]# wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

11.4 MySQL installation (medium)

3. unpack the mysql package :

[email protected] src]# Tar zxvf mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz

4. Move The unpacked package and rename it :

[email protected] src]# MV mysql-5.6.35-linux-glibc2.5-x86_64 /usr/local/mysql

5. Enter the mysql directory:

[email protected] src]# cd/usr/local/ MySQL


6. Create a mysql user :

[email protected] mysql]# Useradd MySQL

7 . root directory, create Data Directory :

[email protected] mysql]# mkdir /data/

8. Install the dependent packages:

[email protected] mysql]# Yum install-y Perl-data-dumper

[email protected] mysql]# Yum install-y Libaio

9. Initialize, Specify the user as mysql, specify the database directory as /data/mysql:

[email protected] mysql]# ./scripts/mysql_install_db--user= MySQL --datadir= /data/mysql

10. Is there any mistake in verifying the execution of the previous command? (number 0 is no problem):

[email protected] mysql]# echo $?

11. Edit The my.cnf configuration file:

[email protected] mysql]# vim/etc/my.cnf

Change the content (three lines in the picture are temporarily commented out with the # number):

datadir= /data/mysql

socket= /tmp/mysql.sock


11.5 MySQL installation (bottom)

12. Copy the shell mysql.server file and rename it to mysqld:

[email protected] mysql]# CP Support-files/mysql.server /etc/init.d/mysqld

Edit mysqld:

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

Change content:

basedir= /usr/local/mysql

datadir= /data/mysql


Set mysqld boot up :

[email protected] mysql]# chkconfig--add mysqld

start the mysqld Service:

[email protected] mysql]# Service mysqld Start

Search the mysql process:

[email protected] mysql]# PS aux |grep mysql

View the port number for MySQL :

[email protected] mysql]# NETSTAT-LNTP

18. Close the mysqld Service:

[email protected] mysql]# Service mysqld Stop

start the mysqld Service (command-line mode):

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

Close the mysqld Service (command line mode):

[email protected] mysql]# Killall mysqld

installation killall command yum install-y psmisc


This article is from the "Lord Peace" blog, please make sure to keep this source http://zhuneianxiang.blog.51cto.com/11621252/1951043

Introduction to lamp architecture; MySQL installation (upper and lower)

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.