Compile and install mysql 5.6 and centosmysql in centos 7
To install a centos 7 Virtual Machine locally, first install the environment and select mysql 5.6. The installation process is as follows:
1. Download mysql 5.6 package
Wget requests
Tar-zxvf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz # copy the extracted mysql directory
Cp-r mysql-5.6.33-linux-glibc2.5-x86_64/usr/local/mysql
2. Add User Groups and users
# Add User Group groupadd mysql # Add User mysql to user group mysqluseradd-g mysql
3. Install
cd /usr/local/mysql/chown -R mysql:mysql ././scripts/mysql_install_db --user=mysqlchown -R root:root ./chown -R mysql:mysql data
The database has been installed.
4.
Start mysql service and add boot start mysql Service
# Add start cp support-files/mysql. server/etc/init. d/mysql
# Start mysql
Service mysql start
An error is reported during startup.
Because the/var/log/mariadb Folder does not exist, we create
mkdir /var/log/mariadb && chown mysql.mysql /var/log/mariadb && sudo -u mysql touch /var/log/mariadb/mariadb.log
Restart
service mysql start
Successful