System environment: Linux CentOS 6.7 x86_64
Database software: MySQL 5.7.132 binary Compiler-free package
Web Services software: Apache 2.4.20
PHP Software: PHP 5.6.25
Install MySQL:
Go to package storage directory: CD/USR/LOCAL/SRC
Download Mysql:wget http://downloads.mysql.com/archives/get/file/mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz from official website or mirror station
Decompression: Tar zxf mysql-5.7.13-linux-glibc2.5-x86_64.tar.gz
Mobile Directory: MV Mysql-5.7.13-linux-glibc2.5-x86_64/usr/local/mysql
Create user mysql:useradd-s/sbin/nologin MySQL
Create a directory for data storage datadir:mkdir-p/data/mysql
Change the genus Group of DataDir: Chown-r mysql/data/mysql
Go to installation directory: Cd/usr/local/mysql
Initialize database:./bin/mysqld--initialize--user=mysql--datadir=/data/mysql
Copy configuration file: CP support-files/my-default.cnf/etc/my.cnf
To modify a configuration file:
# These is commonly set, remove the # and set as required.
Basedir =/usr/local/mysql
DataDir =/data/mysql
Port = 3306
# server_id = ...
Socket =/tmp/mysql.sock
Copy startup script: CP Support-files/mysql.server/etc/init.d/mysqld
To modify the startup script:
Basedir=/usr/local/mysql
Datadir=/data/mysql
Add the system service entry, set to boot:
[Email protected] mysql]# chkconfig--add mysqld
[Email protected] mysql]# chkconfig mysqld on
[[Email protected] mysql]# service mysqld start
This article is from the "Parody Games" blog, so be sure to keep this source http://kevinjin117.blog.51cto.com/11655131/1843797
Lamp-mysql Installation