mysql 5.7 Installation

yum installed rpm package form, a method of mounting mysql:

      method one:

Using yum embodiment, offline installation installation package after downloading mysql

Before installation, first use the View command, determine the system is not installed mysql installation package. Completely remove the previously installed installation package mysql, mysql and installation of directories and files. rpm -qa | grep mysql mysql view the system already installed package, and then use the yum remove mysql-community-common mysql command to uninstall the associated installation package. Use locate mysql command, find related mysql installation directory, and delete. If you do not update the locate database, use the command updatedb update. rm -rf / var / lib / mysql directory delete library files are installed and manually delete the file /etc/my.cnf.

Https://dev.mysql.com/downloads into the URL, click to download the appropriate version of mysql packages (mysql-8.0.18-1.el8.x86_64.rpm-bundle.tar), unpack all kinds of package mysql, wherein mysql-community-client, mysql-community-common, mysql-community-libs, mysql-community-server packages such as mysql prerequisite package installed. Xftp uploaded to the server using the specified directory is assumed to be under / mysqlsoft directory. Switch to mysqlsoft directory using yum install -y mysql-commmunity-server command to be installed.

Whether mysql is installed before using locate command to find the machine, use the command locate mysql-community. Use the tab key completion operation, if not prompted to locate the installation, use yum provides * / locate to find locate the installation package, use the command yum install mlocate to install. After locate mysql-community find the file directory, switch to the file directory. Disconnect the external network, the gateway and dns setting cancellation, detected by the ping command.

After entering the file directory,

①, the installation package rpm by yum install mysql-community command. Installation Sequence yum install mysql-community-common yum install mysql-community-libs yum install mysql-community-client yum install mysql-community-server can be installed in the order Zollinger.

②, create a local source yum, yum be installed. yum provides * / createrepo find createrepo installation package for installation. yum install -y createrepo-0.9.9-28.el7.noarch, using createrepo / root / soft-install, the soft-install directory made into a warehouse source yum, then mysql-8.0.18-1.el8.x86_64. rpm-bundle.tar unpack this directory. Use yum install -y mysql-community-server is automatically installed.

After the installation is complete, use rpm -ql mysql-community-server command to view, you can see the database installed in / var / lib / mysql directory.

Start Service systemctl start mysqld.service    

View mysql temporary login password cat /var/log/mysqld.log | grep "password"

Use the command mysql_secure_installation security initialization, enter the temporary password mysql database, and then modify the password.

Use the command msyql -uroot -p password, you can be the landing operation of the database.

 

 

 

 

 

Method Two:

Using yum way, the installation online.

In the official website to download the repo source mysql,

rpm  -Uvh https://repo.mysql.com//yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm

Under or cd /etc/yum.repos.d/ directory, use wget   https://repo.mysql.com//yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10 .noarch.rpm download and then install it using the rpm.

Use yum install -y mysql-community-server command, can be installed online.

 

Guess you like

Origin www.cnblogs.com/xiaofeng666/p/11961929.html