Get the App
SLTechnology News&Howtos  ›  Database  › 

Install mysql-8.0.21-linux-glibc2.12-x86_64.tar under Linux installation steps

Shulou Source: shulou.com Published: 2022-06-01 06:17:41 11月13日 Update

1. Decompress mysql mysql-8.0.21-linux-glibc2.12-x86_64.tar

Decompression

Tar-xvf mysql-8.0.21-linux-glibc2.12-x86_64.tar

Tar-xvJf mysql-8.0.21-linux-glibc2.12-x86_64.tarr.xz

2. Cp-r mysql-8.0.21-linux-glibc2.12-x86_64 mysql8.21/

3. Add user group groupadd mysql

4. Add the user group useradd-g mysql mysql to which the user product belongs.

5. Check whether the addition is successful, id mysql.

6. Initialization

Bin/mysqld-initialize-user=mysql-basedir=/mysql/mysql8.21-datadir=/mysql/mysql8.21/data

. / mysqld-initialize-user=mysql-basedir=/mysql/mysql8.21-datadir=/mysql/mysql8.21/data

2020-07-15T01:36:10.855350Z 0 [Warning] [MY-011070] [Server] 'Disabling symbolic links using-- skip-symbolic-links (or equivalent) is the default. Consider not using this option as it' is deprecated and will be removed in a future release.

2020-07-15T01:36:10.855903Z 0 [System] [MY-013169] [Server] / mysql/mysql8.21/bin/mysqld (mysqld 8.0.21) initializing of server in progress as process 151504

2020-07-15T01:36:10.930218Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.

2020-07-15T01:36:13.983064Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.

2020-07-15T01:36:16.019130Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: u?B7*9O9&#uj

Record the temporary login password of the previous step root@localhost: 2fZkV6HGCi?

7. Configuration parameter file my.cnf

Vi / mysql/mysql8.21/support-files/my.cnf

[mysqld]

Port = 3308

Socket = / mysql/mysql8.21/run/mysql.sock

Datadir = / mysql/mysql8.21/data

Basedir=/mysql/mysql8.21/

Default_storage_engine = InnoDB

Max_connections = 2048

Open_files_limit = 65535

Max-connect-errors=100000

Skip-name-resolve

Character-set-server=utf8

Log-error = mysql_error.log

Log-bin = / mysql/mysql8.21/log/master-bin

Log-bin-index=/mysql/mysql8.21/log/master-bin.index

Slow_query_log = 1

Slow_query_log_file = / mysql/mysql8.21/log/mysql_slow_query.log

Long_query_time = 10

Relay_log = / mysql/mysql8.21/log/master-relay-bin

Server-id=101

Relay-log-info-repository=TABLE

Master-info-repository=TABLE

Sync_binlog=1

Sync_relay_log=1

Log_slave_updates=1

8. Create RSA private key bin/mysql_ssl_rsa_setup-- datadir=/mysql/mysql8.21/data

9. If you forget the initial password (root)

You can start mysql to skip Mysql password verification

/ mysql/mysql8.21/bin/mysqld_safe-defaults-file=/mysql/mysql8.21/support-files/my.cnf-skip-grant-tables

Use mysql

Update user set authentication_string='' where user='root'

Reset the password to empty (the password cannot be changed directly at this time, it must be set to empty first, otherwise an error will be reported)

Start mysql to change password

Alter user 'root'@'localhost' identified by' mysql8.21'

10. Update the domain attribute.'% 'means external access is allowed:

Mysql > use mysql

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with-A

Database changed

Mysql > update user set host='%' where user = 'root'

Query OK, 1 row affected (0.11 sec)

Rows matched: 1 Changed: 1 Warnings: 0

Mysql > FLUSH PRIVILEGES

Query OK, 0 rows affected (0.01 sec)

Mysql > select host,user,plugin from user

+-- +

| | host | user | plugin | |

+-- +

| |% | root | caching_sha2_password |

| | localhost | mysql.infoschema | caching_sha2_password | |

| | localhost | mysql.session | caching_sha2_password | |

| | localhost | mysql.sys | caching_sha2_password | |

11. Authorization

Mysql > GRANT ALL PRIVILEGES ON *. * TO 'root'@'%'WITH GRANT OPTION

Query OK, 0 rows affected (0.34 sec)

12. A new feature caching_sha2_password has been introduced above mysql8.0.

This password encryption method is not supported by clients below Navicat 12; solution

Modify encryption method

Update user set plugin='mysql_native_password' where user='root'

Tags: Password user method user group encryption step success parameter customer client property ownership file method property report support update login configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Microsoft Huawei vpn