当前位置:网站首页>Installing MySQL for Linux

Installing MySQL for Linux

2022-06-11 05:51:00 Like the wind holding hands

1、 Check if... Has been installed mysql

rpm -qa | grep mysql

2. If there is a deletion

rpm -e --nodeps mysql-libs- edition 

3. Check mysql User groups and users , Create if not

cat /etc/group | grep mysql
cat /etc/passwd |grep mysql
groupadd mysql
useradd -r -g mysql mysql

4. download mysql Installation package

mkdir /usr/local/mysql # create a file 
# establish data Catalog 
mkdir /usr/local/mysql/data
cd mysql
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz

5. decompression

tar xzvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz

6. Compile, install and initialize mysql

cd /usr/local/mysql/bin
./mysqld --initialize --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
#[Note] A temporary password is generated for [email protected]: 7(h4l>Qnj8t3# Is password 

7. start-up mysql

/usr/local/mysql/support-files/mysql.server start
 If the following message appears 
Starting MySQL.Logging to '/usr/local/mysql/data/iZge8dpnu9w2d6Z.err'.
# Query service 
ps -ef|grep mysql
ps -ef|grep mysqld

kill -9 pid # Stop the process 

8. Add soft connection , And restart mysql service

ln -s /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql 
ln -s /usr/local/mysql/bin/mysql /usr/bin/mysql
service mysql restart
# Successful launch !
MySQL server process #3257 is not running! [FAILED]
Starting MySQL.                                            [  OK  ]

9. Isochronous mysql, Change Password

mysql -u root -p

 First install and then , Executing any instruction will prompt :
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
 Change the temporary password 
>ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' PASSWORD EXPIRE NEVER;
 Refresh the permissions 
>flush privileges;

10. Develop remote connections

>use mysql;
>update user set user.Host='%' where user.User='root';
>flush privileges;
原网站

版权声明
本文为[Like the wind holding hands]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020533325293.html