MySQL 8.0.11 GA Version binary installation

Source: Internet
Author: User

MySQL 8.0.11 has been released, heard the performance increase of twice times, today's own installation experience.
1. Uninstall the old version of MySQL
Rpm-qa|grep MySQL or mairadb
Rpm-e mysql*/mariadb*
RPM-E--nodeps mysql*/mariadb*


2. Install dependent packages
Yum Install gcc gcc-c++ libaio

3. Download the package and unzip it
TAR-ZXF mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz-c/opt/mysql

4. Create a soft connection
cd/usr/local/
ln-sv/opt/mysql/mysql-8.0.11-linux-glibc2.12-x86_64 MySQL

5. Create users and Groups
Groupadd-g 301 MySQL
Useradd-g 301-r-s/bin/nologin-u 301 MySQL

6. Related directory structure and permissions
Chown-r Mysql:mysql/usr/local/mysql
Mkdir-p/data
Mkdir-p/data/mysql/data
Mkdir-p/data/mysql/log/binlogs
Mkdir-p/data/mysql/log/slowlogs
Mkdir-p/data/mysql/log/relaylogs
Mkdir-p/data/mysql/undo
Mkdir-p/data/mysql/redologs
Mkdir-p/data/mysql/tmp
Chown-r Mysql:mysql/data/mysql

7. Preparation of MY.CNF files

[Mysqld]
port=3306
Datadir=/data
Log-error=/data/mysql/log/mysql-err.log
User=mysql

[Client]
Socket=/data/mysql/mysql.socket

8. Environment variable Configuration
echo "Export path= $PATH:/usr/local/mysql/bin" >>/etc/profile
Source/etc/profile

9. Initialize the database

Two different ways
Bin/mysqld--initialize--user=mysql
Bin/mysqld--initialize-insecure--user=mysql

I'm using a non-certified encryption method here
#/usr/local/mysql/bin/mysqld--initialize--user=mysql--basedir=/data

10. Start-Stop service

#/usr/local/mysql/bin/mysqld_safe--DEFAULTS-FILE=/USR/LOCAL/MYSQL/ETC/MY.CNF &
#/usr/local/mysql/bin/mysqladmin Shutdown

11. Make Startup script

Copy the startup script into the/ETC/INIT.D directory
# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqld

Modify the script file
# Vim/etc/init.d/mysqld
Installation path of the Basedir=/usr/local/mysql--mysql
Data Catalog for Datadir=/data--mysql

Give this file permission to execute

chmod 755/etc/init.d/mysqld
Start the service
/etc/init.d/mysqld start

Starting MySQL .... [OK]

Note:

For the later 5.7 series versions of MySQL 5.7.6, MySQL initializes the database with the mysqld--initialize or mysqld--initialize-insecure command, which can not generate random passwords.
However, when installing MySQL, the default is to use the previous command, which also generates a random password. The password is saved in the MySQL log file.

After installing MySQL using the rpm command on the CentOS 7 system, the MySQL configuration file is/etc/my.cnf, open the file, you can see the configuration information of MySQL DataDir and log files, and the following:

Datadir=/var/lib/mysql
Log-error=/var/log/mysqld.log

Open the/var/log/mysqld.log file, search string a temporary password is generated for [email protected]:, you can find this random password, usually this line of logs in the first few lines of the log file, more easily seen.

Log in to MySQL with the random password you found, and after the first login, MySQL will not be able to perform any other database operations than it has to modify the default password, which reflects the ever-increasing MySQL security.

12. Enter the database
#/usr/local/mysql/bin/mysql-p

13. View the database version
([email protected]:) [(none)]> \s

Connection Id:9
Current database:
Current User:[email protected]
Ssl:not in use
Current Pager:stdout
Using outfile: '
Using delimiter:;
Server version:8.0.11 MySQL Community SERVER-GPL
Protocol version:10
Connection:localhost via UNIX socket
Server CHARACTERSET:UTF8MB4
Db CHARACTERSET:UTF8MB4
Client CHARACTERSET:UTF8MB4
Conn. characterset:utf8mb4
UNIX Socket:/tmp/mysql.sock
uptime:25 min sec

Threads:2 questions:13 Slow queries:0 opens:110 Flush tables:2 Open tables:86 queries per second avg:0.008
--------------

MySQL 8.0.11 GA Version binary installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.