First, lamp architecture introduction:
linux+ Apache (httpd) + MySQL + PHP
Operating system + Extranet service Software + storage Software + scripting language (developed by C)
PHP website
Three characters can be installed on a machine, can also be separated, but httpd to PHP together (PHP is in the form of a module and Apache together, Apache through PHP and MySQL to deal with,)
Dynamic Request: User login through the account and password Apache,apache through PHP to MySQL data, after the Apache will return to the user login status
Static Request: The user through Apache login, Apache go directly to a Linux directory to get static files or pictures. Don't deal with MySQL
Ii. introduction of MYSQL/MARIADB
MySQL is a relational database. Developed by the MySQL AB company. was acquired by Sun Company in 2008. Sun Corporation (Java) was acquired by Oracle (database) company in 2009. MySQL embarked on a commercial route. Official website: www.mysql.com in version 5.6 began to change relatively large. 5.7 performance has been greatly improved.
MARIADB is a branch of MySQL. Official website for www.mariadb.com, by the original author led most of the original team founded. mariadb5.5 corresponds to mysql5.5,mysql5.6 corresponding to maiadb10.0.
Community Open Source Version
Enterprise Edition
GA generic version, used in reproduction environment
DMR Development Milestone version (with major breakthrough version)
RC Release Candidate version
Beta Dev test version (with possible bugs)
Alpha Internal Beta version
Third, MySQL installation
UNAME-A Viewing current version information
[Email protected] ~]# uname-a
Linux lnmp 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 16:42:41 UTC x86_64 x86_64 x86_64 gnu/linux
R.aminglinux
Installation: RPM (no way to customize the installation path), source code, binary free compilation (can be customized installation path)
Unzip the MySQL binary compiler-free package
Tar zxvf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz
Move him and rename it to
MV Mysql-5.6.36-linux-glibc2.5-x86_64/usr/local/mysql
Switch to the/usr/local/mysql directory
Create a MySQL user
Useradd MySQL
The path to the default storage data file for the MySQL database is/var/lib/mysql, but in practice, we often need to customize the installation database path in order to create data
Mkdir/data
./scripts/mysql_install_db--user=mysql--datadir=/data/mysql Build database system, specify user as MySQL, store database path under/data/
Copy the configuration file to/etc/my.cnf (my.cnf file may already exist, possibly because it was previously installed, or it may be the configuration of another database)
CP SUPPORT-FILES/MY-DEFAULT.CNF/ETC/MY.CNF
Copy MySQL startup script and edit
CP Support-files/mysql.server/etc/init.d/mysqld
Vim/etc/init.d/mysqld
BASEDIR=/USR/LOCAL/MYSQL Specifies the MySQL program directory
DATADIR=/DATA/MYSQL Specifies the MySQL storage data directory
Set the permission to 755 (sometimes by default is 755)
chmod 755/etc/init.d/mysqld
If you want to boot up, add it to the system Services list
Chkconfig--add mysqld Add to System Services list
Chkconfig--list View list of system services
Service mysqld Start//etc/init.d/mysqld start are all starting MySQL services
PA aux|grep MySQL View process
NETSTAT-LNTP viewing the monitored ports
Another way to start the mysql,& symbol is to drop it in the background
Killall mysqld kill MySQL process (do not use kill this command often)
MySQL Common 2-medium engine
InnoDB compare large and MyISAM smaller
The difference between killall and kill is killall rational and will be completed at the end of the process after reading and writing.
Lamp Architecture (Lamp introduction, MYSQL/MARIADB introduction, MySQL installation)