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

jQuery realizes the scrolling effect of table row data

This article example shares the specific code of ...

Using System.Drawing.Common in Linux/Docker

Preface After the project is migrated to .net cor...

Example of implementing login effect with vue ElementUI's from form

Table of contents 1. Build basic styles through E...

Vue custom v-has instruction, steps for button permission judgment

Table of contents Application Scenario Simply put...

Basic operations of mysql learning notes table

Create Table create table table name create table...

How to build svn server in linux

1: Install SVN yum install -y subversion 2. Creat...

Small details of web front-end development

1 The select tag must be closed <select><...

Analysis of JavaScript's event loop mechanism

Table of contents Preface: 1. Reasons for the eve...

HTML cellpadding and cellspacing attributes explained in pictures

Cell -- the content of the table Cell margin (tabl...

Detailed explanation of Vue's caching method example

Recently, a new requirement "front-end cache...

Introduction to the role of HTML doctype

Document mode has the following two functions: 1. ...

How to delete all contents in a directory using Ansible

Students who use Ansible know that Ansible only s...

Nginx location matching rule example

1. Grammar location [=|~|~*|^~|@] /uri/ { ... } 2...

Detailed explanation of the update command for software (library) under Linux

When installing packages on an Ubuntu server, you...