当前位置:网站首页>Install mysql5.7.36 in CentOS

Install mysql5.7.36 in CentOS

2022-07-28 14:13:00 Andy86666

stay centos Install in mysql5.7.36

stay centos Install in mysql5.7.36

( One )、mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar Download resources

mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar

( Two )、 Delete the built-in database

sudo rpm -e --nodeps mariadb-libs

( 3、 ... and )、 decompression mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar

tar -xf mysql-5.7.36-1.el7.x86_64.rpm-bundle.tar

 Insert picture description here

( Four )、 install mysql

Be careful : install mysql, Be sure to pay attention to the sequence

sudo rpm -ivh mysql-community-common-5.7.36-1.el7.x86_64.rpm 
sudo rpm -ivh mysql-community-libs-5.7.36-1.el7.x86_64.rpm 
sudo rpm -ivh mysql-community-libs-compat-5.7.36-1.el7.x86_64.rpm 
sudo rpm -ivh mysql-community-client-5.7.36-1.el7.x86_64.rpm 
sudo rpm -ivh mysql-community-server-5.7.36-1.el7.x86_64.rpm 

 Insert picture description here

( 5、 ... and )、MySQL initialization

sudo mysqld --initialize --user=mysql

 Insert picture description here

( 6、 ... and )、 Check the initial password

stay /etc/my.cnf Check the log storage location

cat /etc/my.cnf

 Insert picture description here

Look in the log file Initial password

cat /var/log/mysql.log 

 Insert picture description here

n:3Evf/(Sled

( 7、 ... and ) land MySQL

Start... First MySQL service

sudo systemctl start mysqld

Be careful : Just start it once , The next boot starts automatically

land MySQL

mysql -u root -p

 Insert picture description here

Change Password

set password=password("root");

 Insert picture description here

You can quit first and try to change the password successfully

( 8、 ... and ) take MySQL Set to any ip You can visit

Be careful : at present MySQL It can only be accessed locally

Related configuration files , stay mysql Medium mysql Library user In the table

 Insert picture description here

stay user Field ,root User host yes localhost( Local )

 Insert picture description here

terms of settlement :

update mysql.user set host="%" where user='root';

Enter the following command again , Take effect immediately

flush privileges;

 Insert picture description here

You can test whether you can access it remotely MySQL

We will windows in Navicat Remote login

 Insert picture description here

原网站

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