Install MySQL5.5 database in CentOS7 environment

Install MySQL5.5 database in CentOS7 environment

1. Check whether MySQL has been installed on the current system

rpm -qa|grep -i mysql 

insert image description here

If the screenshot above appears, you need to delete MySQL

1. Delete related applications

yum remove MySQL-client-5.5.40-1.linux2.6.x86_64
yum remove MySQL-server-5.5.40-1.linux2.6.x86_64

2. View files with MySQL in the file name

find / -name mysql 

insert image description here

If it appears, you need to delete the file according to rm -rf 路徑

3. Delete other MySQL services

//mysql configuration file rm -rf /etc/my.cnf
//If you do not delete this file, the reinstalled MySQL will not be able to set the password
rm -rf /var/log/mysqld.log

2. If it has not been installed, proceed to the next step

1. Unzip the MySQL installation package

tar -zxvf MySQL-5.5.40-1.linux2.6.x86_64.rpm-bundle.tar

insert image description here

You can see that we have unzipped several packages. We only need to install the service and the client.

//Install the server rpm -ivh MySQL-server-5.5.49-1.linux2.6.i386.rpm
//Install the client rpm -ivh MySQL-client-5.5.49-1.linux2.6.i386.rpm

2. Start the MySQL service (if the service fails to start, you need to delete it and reinstall it)

service mysql start

3Set the initial MySQL password

/usr/bin/mysqladmin -u root password 'root'

4. To prevent the service from having to be started every time the computer is turned on, set the MySQL service to start automatically.

//Add to system service:
chkconfig --add mysql
//Automatically start:
chkconfig mysql on

5. Enable remote service

Login to mysql

//-u followed by the username //-p is the initial password you just set mysql -uroot -proot

Create a new account and authorize all permissions to support % that is, any remote address can connect

//The latter is the password, which is used when we connect using the visualization software. grant all privileges on *.* to 'root' @'%' identified by '123456'; 

Refresh permissions

flush privileges;

6. Open port Open Linux port 3306

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT

Save settings

/etc/rc.d/init.d/iptables save

Summarize

Don't forget to open the port. If you don't open the port, the MySQL view management software on Windows will not be able to connect.

This is the end of this article about installing MySQL 5.5 database in CentOS 7 environment. For more information about installing MySQL 5.5 in CentOS 7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Complete steps to install MySQL 5.5 on CentOS
  • The process of installing MySQL 8.0.26 on CentOS7
  • Steps to install MySQL 8.0.23 under Centos7 (beginner level)
  • Centos7 mysql database installation and configuration tutorial
  • Centos7 installation of MySQL8 tutorial

<<: 

>>:  Implementation code for taking screenshots using HTML and saving them as local images

Recommend

Historical Linux image processing and repair solutions

The ECS cloud server created by the historical Li...

Detailed explanation and extension of ref and reactive in Vue3

Table of contents 1. Ref and reactive 1. reactive...

CSS makes tips boxes, bubble boxes, and triangles

Sometimes our pages will need some prompt boxes o...

How to install nginx on win10

Because the company asked me to build a WebServic...

Solution to define the minimum height of span has no effect

The span tag is often used when making HTML web pa...

Vue3 (V) Details of integrating HTTP library axios

Table of contents 1. Install axios 2. Use of axio...

Mysql5.7.14 Linux version password forgotten perfect solution

In the /etc/my.conf file, add the following line ...

How to quickly deploy Redis as a Docker container

Table of contents getting Started Data storage Co...

mysql installer web community 5.7.21.0.msi installation graphic tutorial

This article example shares the specific code for...

Development details of Vue3 components

Table of contents 1. Introduction 2. Component De...

Example of how to set div background transparent

There are two common ways to make div background ...

Detailed explanation of Vue3's sandbox mechanism

Table of contents Preface Browser compiled versio...