Detailed tutorial on installing MySQL offline on CentOS7

Detailed tutorial on installing MySQL offline on CentOS7

1. Delete the original mariadb, otherwise mysql cannot be installed

mariadb-libs-5.5.52-1.el7.x86_64
rpm -qa|grep mariadb
rpm -e --nodeps mariadb-libs

1. Select Red Hat Enterprise Linux 7 / Oracle Linux 7 from https://dev.mysql.com/downloads/mysql/ and select all for the OS version.

Download mysql-5.7.21-1.el7.x86_64.rpm-bundle.tar directly, all rpm packages are in it

rpm -ivh mysql-community-common-5.7.21-1.el7.x86_64.rpm
 rpm -ivh mysql-community-libs-5.7.21-1.el7.x86_64.rpm 
rpm -ivh mysql-community-devel-5.7.21-1.el7.x86_64.rpm 
rpm -ivh mysql-community-libs-compat-5.7.21-1.el7.x86_64.rpm 
rpm -ivh mysql-community-client-5.7.21-1.el7.x86_64.rpm
 rpm -ivh mysql-community-server-5.7.21-1.el7.x86_64.rpm

At this point, all mysql5.7 files have been installed, and the next step is to start the service test.

1. First shut down the mysql service:

service mysqld stop

2. Then modify the configuration file:

vim /etc/my.cnf

3. Next, add a line of code to log in to MySQL with an empty password:

# Disabling symbolic-links is recommended to prevent assorted security risks
skip-grant-tables #Add this sentence, then you don't need a password to log in to MySQL symbolic-links=0

4. Start the mysql service:

service mysqld start

5. Log in to mysql with an empty password:

mysql -u root -p #輸入命令回車進入,出現輸入密碼提示直接回車

6. Set mysql password:

mysql> set password for root@localhost = password('123456');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql> flush privileges; #Update privileges Query OK, 0 rows affected (0.00 sec)
mysql> set password for root@localhost = password('123456'); 
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>flush privileges; #Update privilegesmysql>quit; #Exitservice mysqld stop #Stop MySQL service and restore MySQL configurationvim /etc/my.cnf #Modify configuration file# Disabling symbolic-links is recommended to prevent assorted security risks
# skip-grant-tables # Comment out this sentence symbolic-links=0
service mysqld start # Start mysql service mysql -uroot -p # Enter new password to log in

7. Set MySQL to start automatically at boot:

systemctl enable mysqld

Summarize

The above is the tutorial on CentOS7 offline installation of MySQL introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • centos7.2 offline installation mysql5.7.18.tar.gz
  • Detailed explanation of how to install offline JDK1.8 on centos7.0
  • Install mysql offline using rpm under centos 6.4
  • CentOS installation steps for Mogodb (online &&offline)
  • CentOS offline installation of gcc (version 4.8.2) detailed introduction
  • Detailed installation of Mongodb in CentOS (online and offline)
  • CentOS/RedHat 6.5 Offline Installation of Docker

<<:  How to permanently change the host name in Linux

>>:  The most complete package.json analysis

Recommend

Detailed explanation of MySQL monitoring tool mysql-monitor

1. Overview mysql-monitor MYSQL monitoring tool, ...

Two solutions for automatically adding 0 to js regular format date and time

Table of contents background Solution 1 Ideas: Co...

How to enable Swoole Loader extension on Linux system virtual host

Special note: Only the Swoole extension is instal...

Vue implements a simple calculator

This article example shares the specific code of ...

Native JS to achieve draggable login box

This article shares a draggable login box impleme...

Detailed explanation of Tomcat core components and application architecture

Table of contents What is a web container? The Na...

Example of implementing TikTok text shaking effect with CSS

In daily development, front-end students often ar...

A brief discussion on the CSS overflow mechanism

Why do you need to learn CSS overflow mechanism i...

Graphical explanation of the function call of proto file in Vue

1. Compile proto Create a new proto folder under ...

Complete steps to quickly build a vue3.0 project

Table of contents 1. We must ensure that the vue/...

How to make a tar file of wsl through Docker

I've been playing with the remote development...

MySQL aggregate function sorting

Table of contents MySQL result sorting - Aggregat...