centos7 installation package mysql8.0.18 rpm-bundle official website to download

 

A resource address

Download   https://dev.mysql.com/downloads/mysql/

Second, pre-installation preparation, unloading comes mariadb, installation depend on the environment

Installed listed mariadb

[root @ MySQL ~] # RPM -qa | grep MariaDB 
MariaDB -libs- 5.5 . 60 - 1 .el7_5.x86_64 
Method One: RPM -e - nodeps unloading MariaDB 
[MySQL root @ ~] # RPM -e - nodeps libs--MariaDB 5.5 . 60 - . 1 .el7_5.x86_64 
method two: yum - Y Remove unloading MariaDB 
[MySQL the root @ ~] # yum -Y-libs- Remove MariaDB 5.5 . 60 - . 1 .el7_5.x86_64

 

If there is excess residual directory delete it, no skip

[root@mysql ~]# find / -name mysql -print
如下:
[root@mysql ~]# rm -rf /var/lib/mysql
[root@mysql ~]# rm -rf /var/lib/mysql/mysql
[root@mysql ~]# rm -rf /usr/bin/mysql
[root@mysql ~]# rm -rf /usr/lib64/mysql

 

Installed base of software.

[root @ MySQL ~] # yum -y install  wget (or if you do not have ftp upload lrzsz) 
[root @ MySQL ~] # yum -y install lrzsz (simple and easy uploading and downloading software) 
[root @ MySQL ~] # yum -y install vim

 

Software installation dependent.

[root@mysql ~]# yum -y install net-tools
[root@mysql ~]# yum -y install openssl openssl-devel
[root@mysql ~]# yum -y install libaio libaio-devel
[root@mysql ~]# yum -y install perl perl-devel
[root@mysql ~]# yum -y install perl-JSON.noarch
[root@mysql ~]# yum -y install autoconf

 

Third, view, close firewall firewall

[root@mysql home]# firewall-cmd --state
[root@mysql home]# systemctl stop firewalld.service
[root@mysql home]# systemctl disable firewalld.service

 

Fourth, close SELinux, into the / etc / selinux / config file, SELINUX = enforcing to SELINUX = disabled

[root@mysql home]# vi /etc/selinux/config

 

Fifth, the Restart CentOS ...

[root@mysql home]# reboot

 

Sixth, upload the mysql tar package, extract the tar package

[root@mysql ~]# cd /home
[root@mysql home]# tar -xvf mysql-8.0.17-1.el7.x86_64.rpm-bundle.tar
[root@mysql mysql]# ls -lShr

 


Seven, to start the installation mysql

PS:注意安装顺序 common -> libs -> client -> server
[root@mysql mysql]# rpm -ivh mysql-community-common-8.0.17-1.el7.x86_64.rpm
[root@mysql mysql]# rpm -ivh mysql-community-libs-8.0.17-1.el7.x86_64.rpm
[root@mysql mysql]# rpm -ivh mysql-community-client-8.0.17-1.el7.x86_64.rpm
[root@mysql mysql]# rpm -ivh mysql-community-server-8.0.17-1.el7.x86_64.rpm

[root@mysql mysql]# rpm MySQL-Community-libs -ivh-compat- 8.0 . . 17 - . 1 .el7.x86_64.rpm (optional) 
[the root MySQL MySQL @] # RPM -ivh MySQL-Community-devel- 8.0 . . 17 - . 1 .el7.x86_64 .rpm (optional) 
[the root MySQL MySQL @] # RPM -ivh MySQL-Community-Embedded-compat- 8.0 . . 17 - . 1 .el7.x86_64.rpm (optional) 
[the root MySQL MySQL @] # RPM -ivh MySQL Test---community 8.0 . 17 - 1 .el7.x86_64.rpm (optional) 

[root @ MySQL MySQL] # RPM -qa | grep MySQL

 

 

Eight, initialize the database, catalog authorized, start mysql service [Note the order of operations]

[root@gnome mysql]# mysqld --initialize --console
[root@gnome mysql]# chown -R mysql:mysql /var/lib/mysql/
[root@gnome mysql]# systemctl start mysqld

 

Nine, to see if a successful start, active (running)

 

[root@gnome mysql]# mysqld --initialize --console
[root@gnome mysql]# chown -R mysql:mysql /var/lib/mysql/
[root@gnome mysql]# systemctl start mysqld

 

Ten, after the temporary password to view the initialization

[root@gnome mysql]# grep 'temporary password' /var/log/mysqld.log
或者
[root@gnome mysql]# cat /var/log/mysqld.log | grep 'temporary password'

 

XI, log in mysql

[root @ Home MySQL] # MySQL -u root - the p- 
the Enter password: pasted directly initial password, press Enter

 


XII modify the initial password, remote login authorization

mysql> the ALTER the USER ' root ' @ ' localhost ' IDENTIFIED BY ' HomeTest $ 2019 ' ; (modified "HomeTest $ 2019 " as your password) 
mysql > use mysql; (switch to the mysql database) 
mysql > Update the User the SET Host = " % " the WHERE the User = ' root ' ; (authorized remote login) 
MySQL > flush privileges; (refresh) 
MySQL > quit; (Log)

 

XIII, test the connection is normal


Installed

 


Original link: https: //blog.csdn.net/Airmoer/article/details/100012216

 

Guess you like

Origin www.cnblogs.com/tongcharge/p/11790316.html