mysql bis main installation (a)
mysql double main software installation of installation mysql
(Both nodes)
First, the environment Introduction
CentOS7.6 + Mysql 8.0.18
Second, the installation step
2.1, environmental inspections
Because CentOS comes mariadb, there will be a conflict when you install mysql
Thus uninstall before installing mysql mariadb
Unloading system comes mariadb-libs, otherwise it will lead to not install mysql-community-libs.
# rpm -qa|grep mariadb mariadb-libs-5.5.64-1.el7.aarch64
2.2, download the installation package
https://downloads.mysql.com/archives/community/
2.3, the installation package uploaded to the server and decompress
(Upload tool you can use WinSCP)
[root@mysqldb3 mysql-rpm]# tar -xvf mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar mysql-community-libs-8.0.18-1.el7.x86_64.rpm mysql-community-devel-8.0.18-1.el7.x86_64.rpm mysql-community-embedded-compat-8.0.18-1.el7.x86_64.rpm mysql-community-libs-compat-8.0.18-1.el7.x86_64.rpm mysql-community-common-8.0.18-1.el7.x86_64.rpm mysql-community-test-8.0.18-1.el7.x86_64.rpm mysql-community-server-8.0.18-1.el7.x86_64.rpm mysql-community-client-8.0.18-1.el7.x86_64.rpm
2.4 Installation
[root@mysqldb2 mysql-rpm]# rpm -ivh mysql-community-common-8.0.18-1.el7.x86_64.rpm warning: mysql-community-common-8.0.18-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-common-8.0.18-1.e################################# [100%] [root@mysqldb2 mysql-rpm]# rpm -ivh mysql-community-libs-8.0.18-1.el7.x86_64.rpm warning: mysql-community-libs-8.0.18-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-libs-8.0.18-1.el7################################# [100%] [root@mysqldb2 mysql-rpm]# rpm -ivh mysql-community-client-8.0.18-1.el7.x86_64.rpm warning: mysql-community-client-8.0.18-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-client-8.0.18-1.e################################# [100%] [root@mysqldb2 mysql-rpm]# rpm -ivh mysql-community-server-8.0.18-1.el7.x86_64.rpm warning: mysql-community-server-8.0.18-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY Preparing... ################################# [100%] Updating / installing... 1:mysql-community-server-8.0.18-1.e################################# [100%]
2.5, modify the configuration file
[mysqldb1 the root @ Soft] # VI / etc / the my.cnf first /etc/my.cnf profile " default = mysql_native_password-authentication-plugin " Notes removed Port = 6612 lower_case_table_names = . 1 max_connections = 2000 log_bin_trust_function_creators = . 1
2.6, start mysql service
systemctl start mysqld
2.7, view the password file
MySQL will give us in / var / log / under mysqld.log, as the root user to generate a new password to view the initialization code: grep ' the Temporary password ' / var / log / mysqld.log [root @ mysqldb3 MySQL -rpm] # grep ' Temporary password ' / var / log / mysqld.log 2019 - 03 -08T08: 56 is : 56 is .984943Z . 5 [Note] [MY- 010 454 ] [Server] A Temporary Generated IS password for the root @ localhost: efkAnA) S1py,
2.8, log on and change your password
mysql -uroot -p
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'Hankey12#$'; Query OK, 0 rows affected (0.03 sec) mysql> select host,user,plugin from mysql.user; +-----------+------------------+-----------------------+ | host | user | plugin | +-----------+------------------+-----------------------+ | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | mysql_native_password | +-----------+------------------+-----------------------+ 4 rows in set (0.00 sec) mysql>
2.9, the remote client logon settings
The above figure would definitely not be the root user from remote login, in fact, slightly modified to Update the mysql.user the SET plugin = ' mysql_native_password ' the WHERE the User = ' root ' ; # if the plugin is mysql_native_password normal is not to amend
the same time, FIG root user on the login is not from the remote, and the reason is due to the type of host root of only native
Update the mysql.user SET host = ' % ' WHERE user = ' root ' ;
execution is completed, the refresh permissions
flush privileges;
you can use the remote root login