MySQL 8.4 Linux Binary Package Installation and Deployment Process

Download

wget https://cdn.mysql.com//Downloads/MySQL-8.4/mysql-8.4.7-linux-glibc2.28-aarch64.tar.xz

Set Up Directory

mkdir /data/mysql 
scp mysql-8.4.7-linux-glibc2.28-aarch64.tar.xz /data/mysql
cd /data/mysql
tar -xvf mysql-8.4.7-linux-glibc2.28-aarch64.tar.xz
cd /data/mysql/mysql-8.4.7-linux-glibc2.28-aarch64
mv * ../

Create User

groupadd mysql
useradd -r -g mysql mysql
chown mysql:mysql -R /data/mysql

Configuration File

[mysqld]
port=3306
mysqlx_port=33060
datadir=/data/mysql/data
socket=/data/mysql/mysqld.sock
pid-file=/data/mysql/mysqld.pid
max_allowed_packet = 1G
innodb_log_file_size = 512M
innodb_log_buffer_size = 512M
innodb_file_per_table = 1
innodb_buffer_pool_size=64G
innodb_flush_log_at_trx_commit=0
max_connections=2000
lower-case-table-names=1
innodb_strict_mode = 0
character_set_server=utf8mb3
secure_file_priv =
default-time-zone='+08:00'
transaction-isolation = READ-COMMITTED
#default_authentication_plugin=mysql_native_password
mysql_native_password=ON
log-bin = /data/mysql/mysql-bin.log
skip-log-bin
performance_schema = on
binlog_expire_logs_seconds = 604800
federated
[mysql]
prompt="\u@\h : \d \r:\m:\s>"
socket=/data/mysql/mysqld.sock
default-character-set=utf8mb3

Initialization and Startup

/data/mysql/bin/mysqld \
--defaults-file=/data/mysql/my.cnf  \
--initialize-insecure --user=mysql  
nohup /data/mysql/bin/mysqld --defaults-file=/data/mysql/my.cnf --user=mysql  & 

Change Password

/data/mysql/bin/mysql -uroot  -S /data/mysql/mysqld.sock
SELECT * FROM INFORMATION_SCHEMA.PLUGINS 
WHERE PLUGIN_NAME = 'mysql_native_password';

create user root@'%' identified WITH mysql_native_password by 'Testxxxxx' ;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
flush privileges ;

Some Notes

In version 8.0.42 of MySQL, it is still necessary to use: 
default_authentication_plugin=mysql_native_password
However, in MySQL 8.4.7, it must be changed to: 
mysql_native_password=ON

In 8.0.42, the default encryption plugin can be used without specifying with mysql_native_password
But in 8.4.7, it must include with mysql_native_password

There are also differences in the initialization and startup parameters of the database, which are quite detailed
It is necessary to distinguish and confirm based on different database versions.

Leave a Comment