current position:Home>Hadoop environment setup (MySQL environment configuration)

Hadoop environment setup (MySQL environment configuration)

2022-01-26 21:58:44 cyjku

1. take Mysql Upload it to linux Next /opt/software in

2. Check if the current system has been installed Mysql:   

rpm -qa|grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64 // If there is a problem, use the following command to unload 
rpm -e --nodeps  mariadb-libs-5.5.56-2.el7.x86_64

 3. take MySQL Extract the installation package to /opt/module/ In the folder , command :

cd /opt/software/ 
tar -xf  The name of the file to unzip  -C /opt/module

4. Install the corresponding rpm file

① Get plug-ins , command :

yum install -y libaio

②  Execute command in turn :

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

 5. Switch to /etc

cd /etc

  see file , Make changes

cat my.cnf

 6. Switch to /var/lib/mysql, And delete all files

rm -rf  *

 7. Reset mysql:

mysqld --initialize --user=mysql

8.  View the generated random password :

cat /var/log/mysqld.log

9. start-up MySQL service , command :

systemctl start mysqld

① Sign in MySQL database , command :

mysql -uroot -p
Enter password:    Enter the temporarily generated password 

② Must be modified root User password , Otherwise, an error will be reported when performing other operations , command :

mysql> set password = password(" New password ");

③ modify MySQL Database based user In the table root The user allows any IP Connect , command :

mysql> update mysql.user set host='%' where user='root';
mysql> flush privileges;

Come here MySQL The installation configuration of is over

copyright notice
author[cyjku],Please bring the original link to reprint, thank you.