MySQL 8 The official version 8.0.11 has been released. Officially, MySQL 8 is 2 times faster than MySQL 5.7, and it also brings a lot of improvements and Faster performance!
The following is a record of my installation process on April 23, 2018. The whole process takes about an hour, and the make && make install process takes a long time.
CentOS7.4 64-bit minimal installation
Preparation
Installation dependencies
yum -y install wget cmake gcc gcc-c++ ncurses ncurses-devel libaio-devel openssl openssl-devel
http://mirrors.sohu.com/mysql/MySQL-8.0/mysql-boost-8.0.11.tar.gz (This version has With boost)
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
mkdir -p /usr/local/mysql
mkdir -p /data/mysql
Three. Install MySQL8.0.11
tar -zxf mysql-boost-8.0.11.tar.gz -C /usr/local
cd /usr/local/mysql-8.0.11
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DSYSCONFDIR=/etc -DMYSQL_TCP_PORT=3306 -DWITH_BOOST=/usr/local/mysql-8.0.11/boost
make && make install
cat /etc/my.cnf
[mysqld]
server-id=1
port=3306
basedir=/usr/local/mysql
datadir=/data/mysql
chown -R mysql:mysql /usr/local/mysql
chown -R mysql:mysql /data/mysql
chmod 755 /usr/local/mysql -R
chmod 755 /data/mysql -R
bin/mysqld --initialize --user=mysql --datadir=/data/mysql/
bin/mysql_ssl_rsa_setup
bin/mysqld_safe --user=mysql &
bin/mysql -uroot -p
mysql> alter user 'root'@'localhost' identified by "123456";
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> create user root@'%' identified by '123456';
Query OK, 0 rows affected (0.08 sec)
mysql> grant all privileges on . to root@'%';
Query OK, 0 rows affected (0.04 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
ln -s /usr/local/mysql/bin/* /usr/local/bin/
mysql -h 127.0.0.1 -P 3306 -uroot -p123456 -e "select version();"
mysql: [Warning] Using a password on the command line interface can be insecure.
+-----------+
| version() |
+-----------+
| 8.0.11 |
+-----------+
cp support-files/mysql.server /etc/init.d/mysql.server
Hereby explain: MySQL officially recommends binary installation. (The picture below is a screenshot of the official document)
This article will permanently update the link address: https://www.linuxidc.com/Linux/2018-04/152010.htm
Recommended Posts