当前位置:网站首页>mysql_ Download and installation of Linux version

mysql_ Download and installation of Linux version

2022-04-23 18:48:00 Glasses &

1、mysql The download

MySQL Download address of official website of : Official website
 Insert picture description here
 Insert picture description here
 Insert picture description here
 Insert picture description here

2、mysql Installation

Upload to : /usr/local/mysql
see centos Self contained mysql, Remove if present

rpm -qa | grep mysql #  see 
rpm -ev mysql-libs-* --nodeps #  Delete 

install rpm package

rpm -ivh mysql-community-client-5.7.25-1.el6.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-common-5.7.25-1.el6.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-libs-5.7.25-1.el6.x86_64.rpm --force --nodeps
rpm -ivh mysql-community-server-5.7.25-1.el6.x86_64.rpm --force --nodeps


–force --nodeps: Does not check dependencies during installation

start-up mysql

 #  see mysql The state of 
service mysqld status
service mysqld start

Initialize random password

cat /var/log/mysqld.log | more

View random password :

grep pass /var/log/mysqld.log --color

Log in and change the password :

[root@web ~]#mysql -uroot -p
mysql> set password='Pwd@123456';
mysql> grant all privileges on *.* to 'root'@'%' identified by 'Pwd@123456';

Set power on self start

chkconfig --add mysql
#  See if it is added successfully 
chkconfig --list 

If the previous step is not successful , Then add it to the startup configuration file manually

vim /etc/rc.d/rc.local
#  add to 
service mysqld start

Firewall port policy

#  add to 3306 port 
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT 
#  preservation 
/etc/init.d/iptables save
#  restart  
service iptables restart 
#  Check the status   
/etc/init.d/iptables status 

版权声明
本文为[Glasses &]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231848086201.html