The most detailed and comprehensive installation of MySQL client server under Linux in the history of the whole network

Big data learning monk 2022-02-13 07:18:35 阅读数:269

detailed comprehensive installation mysql client

The most detailed and comprehensive in the history of the whole network Linux Lower installation mysql Client server Linux Lower installation mysql

1. Upload MySQL5.6 Of tar package

Create directory :

mkdir /usr/local/src/mysql5.6

Upload :MySQL-5.6.34-1.rhel5.x86_64.rpm-bundle.tar Go to the directory above

2. install

First step : decompression

command :tar -xvf MySQL-5.6.34-1.rhel5.x86_64.rpm-bundle.tar

The second step : Check if it has been installed mysql

command :rpm -qa | grep mysql

If already installed , Unload it , Such as :

rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64

The third step : install MySQL The service side

command :rpm -ivh MySQL-server-5.6.34-1.rhel5.x86_64.rpm

Step four : install MySQL The client of

command :rpm -ivh MySQL-client-5.6.34-1.rhel5.x86_64.rpm

Step five : see MySQL Service running status

command :service mysql status

Step five : start-up MySQL service

command :service mysql start

Step six : Use root To login mysql

  • Tips :

In the installation mysql server There is a hint :

Be careful : This password is not secure , All need to change the initial password .

1、 Log in with password mysql account number :mysql -uroot -p

2、 modify root password :SET PASSWORD = PASSWORD(‘root’);

3. Boot auto start settings

Add to system services :

chkconfig --add mysql

Auto start :

chkconfig mysql on

Query list :


explain : It's not closed (off) There is no automatic start .

4. Turn on Remote Access

Sign in :

mysql -uroot -proot

Set up remote access ( Use root password ):

grant all privileges on *.* to 'root' @'%' identified by 'root';
flush privileges;

Set the specified ip visit :

grant all privileges on *.* to ‘root’@’’ identified by ‘Talent123(mysql password )’ with grant option ;

sign out mysql, stay centos Open in the environment 3306 A firewall

/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/rc.d/init.d/iptables save
/etc/init.d/iptables status

mysql Solution to installation failure :
 Insert picture description here

Centos7 Loading and unloading mariadb
The first way :
1、 uninstall mariadb:

yum remove mariadb
rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 --nodeps

2、 Delete profile :

rm -f /etc/my.cnf

3、 Delete data directory :

rm -rf /var/lib/mysql/

The second way ,rpm uninstall :
1. Query whether the is installed mariadb

rpm -qa | grep mariadb

2. uninstall mariadb

 rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64

Be careful , There may be mariadb Some dependencies are required to uninstall , Or uninstall after installing dependencies , Or as follows , Force uninstall :

rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 --nodeps
copyright:author[Big data learning monk],Please bring the original link to reprint, thank you.