Lamp Architecture Introduction
Lamp refers to L (Linux), A (Apache), M (MySQL), P (PHP), apache+php need to be in a host, MySQL can be separate or run on the same host.
The operating modes are as follows:
650) this.width=650; "Src=" Https://s5.51cto.com/oss/201711/08/4a19cd26869d4fd4324c3211d4f582dd.png-wh_500x0-wm_3 -wmp_4-s_1844067113.png "title=" 1.png "alt=" 4a19cd26869d4fd4324c3211d4f582dd.png-wh_ "/>
Static files: Pictures, documents, without loading MySQL to fetch data
Dynamic file: JS and other through the PHP module call MySQL, and then through the Apache display to achieve dynamic resources
MYSQL,MARIADB Introduction
MySQL: relational database, developed by Sun Company and acquired by Oracle Corporation;
Its version:
Community Community Edition, Enterprise Business Edition, GA (generally available) General edition, used in production environments; DMR (development milestone release) development milestone version ; RC (Release Candidate) Release candidate version; beta version; Alpha internal beta version.
MariaDB: Basically consistent with MySQL, is a branch of MySQL.
MySQL Installation
Common installation Packages:
RPM Package (RPM-IVH installation)
Source Code package (compilation installation, time-consuming, usually also more than 20 minutes)
Binary Compiler-Free package (already compiled, can be used directly, simple and quick installation)
1. Download the installation package (binary free compile package):
[Email protected] package]# wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
2. Decompression
[Email protected] package]# Tar XF mysql-5.6.35-linux-glibc2.5-x86_64.tar.gz
3, [[email protected] package]# MV Mysql-5.6.35-linux-glibc2.5-x86_64/usr/local/mysql
4. Create MySQL, Data directory
[[email protected] mysql]# useradd MySQL
[Email protected] mysql]# mkdir/data/
5, install the appropriate package
[email protected] mysql]# Yum install-y perl-data-dumper libaio* libaio-dev*
6. Initialization
[Email protected] mysql]#/scripts/mysql_install_db--user=mysql--datadir=/data/mysql
7. Verify that it is correct
[[email protected] mysql]# echo $?
0
8, copy the configuration file to/etc
[email protected] mysql]# CP support-files/my-default.cnf/etc/my.cnf
Cp:overwrite '/etc/my.cnf '? Y
9, add datadir, Socket:
[Email protected] mysql]# CAT/ETC/MY.CNF
# for advice The change settings
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# * * * Don't EDIT this FILE. It ' s a template which'll be copied to the
# * * * default location during install, and would be replaced if you
# * * * * Upgrade to a newer version of MySQL.
[Mysqld]
Datadir=/data/mysql
Socket=/tmp/mysql.sock
# Remove Leading # and set to the amount of RAM for the most important data
# Cache in MySQL. Start at 70% of all RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
10. Startup script:
[email protected] mysql]# CP support-files/mysql.server/etc/init.d/mysqld
[Email protected] mysql]# Vi/etc/init.d/mysqld
Basedir=/usr/local/mysql
Datadir=/data/mysql
11, [[email protected] mysql]# chmod 755/etc/init.d/mysqld
12.
[Email protected] mysql]# chkconfig--add mysqld
[Email protected] mysql]# chkconfig--list| grep mysqld
Note:this output shows SysV services only and does not include native
SYSTEMD Services. SysV configuration data might is overridden by native
SYSTEMD configuration.
If you want to list SYSTEMD services use ' Systemctl list-unit-files '.
To see services enabled on particular target use
' Systemctl list-dependencies [target] '.
Mysqld 0:off1:off2:on3:on4:on5:on 6:off
13. Start
[[email protected] mysql]#/etc/init.d/mysqld start
14, [[email protected] mysql]# netstat-nutlp| grep mysqld
TCP6 0 0::: 3306:::* LISTEN 18112/mysqld
14. Error message:
[Email protected] ~]# Killall
-bash:killall:command not found
FIX: [[email protected] ~]# Yum install psmisc-y
15, [[email protected] ~]# Killall mysqld
16. When there is no startup script, start as follows:
[Email protected] ~]#/usr/local/mysql/bin/mysqld_safe--defaults-file=/etc/my.cnf--user=mysql--datadir=/data/ MySQL &
17, [[email protected] ~]# PS aux|grep MySQL
This article is from the "Discover new things" blog, make sure to keep this source http://shenj.blog.51cto.com/5802843/1979858
Lamp architecture Introduction, MYSQL,MARIADB Introduction, MySQL Installation