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

In-depth explanation of MySQL user account management and permission management

Preface The MySQL permission table is loaded into...

Use of MySQL triggers

Triggers can cause other SQL code to run before o...

React-native sample code to implement the shopping cart sliding deletion effect

Basically all e-commerce projects have the functi...

Detailed explanation of JavaScript function introduction

Table of contents Function Introduction function ...

MYSQL database GTID realizes master-slave replication (super convenient)

1. Add Maria source vi /etc/yum.repos.d/MariaDB.r...

Detailed steps to install MySQL 8.0.27 in Linux 7.6 binary

Table of contents 1. Environmental Preparation 1....

Summary of HTML horizontal and vertical centering issues

I have encountered many centering problems recent...

WeChat applet implements search function and jumps to search results page

Search Page: search.wxml page: <view class=&qu...

Modification of the default source sources.list file of ubuntu20.04 LTS system

If you accidentally modify the source.list conten...

How to choose between MySQL CHAR and VARCHAR

Table of contents VARCHAR and CHAR Types Conclusi...

How to implement html input drop-down menu

Copy code The code is as follows: <html> &l...

How to operate the check box in HTML page

Checkboxes are very common on web pages. Whether ...

Detailed tutorial on installing mysql on centos 6.9

1. Confirm whether MySQL has been installed. You ...

How to use Docker Compose to implement nginx load balancing

Implement Nginx load balancing based on Docker ne...