[TOC]
MySQL install
Remove old version
- Check that the system has been installed MySQL/MariaDB
rpm -qa |grep mysql
rpm -qa |grep mariadb
- Remove installed mariadb Components
rpm -ev --nodeps mariadb-libs
download MySQL
cd /tmp
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.20-1.el8.x86_64.rpm-bundle.tar
tar -xvf mysql-8.0.20-1.el8.x86_64.rpm-bundle.tar
install MySQL
rpm -ivh mysql-community-common-8.0.20-1.el8.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.20-1.el8.x86_64.rpm
rpm -ivh mysql-community-client-8.0.20-1.el8.x86_64.rpm
rpm -ivh mysql-community-server-8.0.20-1.el8.x86_64.rpm
rpm -ivh mysql-community-devel-8.0.20-1.el8.x86_64.rpm
modify my.cnf
This must be modified first my.cnf, To start the service for the first time ( initialization ) When , Use the upper parameter lower_case_table_names
vi /etc/my.cnf
- Add the following
############################################################################
lower_case_table_names=1
default_authentication_plugin=mysql_native_password
default-time_zone = '+8:00'
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
character-set-server = utf8mb4
performance_schema_max_table_instances = 600
table_definition_cache = 400
table_open_cache = 256
[mysql]
default-character-set = utf8mb4
[client]
default-character-set = utf8mb4
############################################################################
start-up MySQL service
- Start the service , Also initialize the database
systemctl start mysqld.service
- Check the temporary password
grep 'temporary password' /var/log/mysqld.log
2020-05-13T05:04:30.405961Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ########
to update root Password and create a new user
root Local account
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '********' PASSWORD EXPIRE NEVER;
dba Local account
DROP USER 'dba'@'localhost';
CREATE USER 'dba'@'localhost' IDENTIFIED BY '********' PASSWORD EXPIRE NEVER;
GRANT ALL PRIVILEGES ON *.* TO 'dba'@'localhost';
FLUSH PRIVILEGES;
dba Remote account
DROP USER 'dba'@'%';
CREATE USER 'dba'@'%' IDENTIFIED BY '********' PASSWORD EXPIRE NEVER;
GRANT ALL PRIVILEGES ON *.* TO 'dba'@'%';
FLUSH PRIVILEGES;