Big Data deployment environment installation --MySQL

Big Data environment deployment --MySQL installation
check whether the MySQL installation
to check whether the installation MariaDB
check the firewall is turned off
to download the installation package rpm
-extracting installer
modify the password
settings Telnet

Here we take the form of rpm package for installation.
Of the rpm command do not understand, can refer to: Linux common commands --rpm simple to use
to check whether the MySQL installation
to check whether the Linux install MySQL

rpm -qa|grep mysql
mysql-community-libs-5.7.27-1.el7.x86_64
mysql-community-client-5.7.27-1.el7.x86_64
mysql-community-common-5.7.27-1.el7.x86_64
mysql-community-libs-compat-5.7.27-1.el7.x86_64
mysql-community-server-5.7.27-1.el7.x86_64

If there is MySQL version, uninstall all its dependencies. E.g

rpm -e --nodeps mysql-community-libs-5.7.27-1.el7.x86_64
rpm -e --nodeps mysql-community-client-5.7.27-1.el7.x86_64
rpm -e --nodeps mysql-community-common-5.7.27-1.el7.x86_64
rpm -e --nodeps mysql-community-libs-compat-5.7.27-1.el7.x86_64
rpm -e --nodeps mysql-community-server-5.7.27-1.el7.x86_64

Note: If you use an ordinary delete mode rpm -e mysql error, you can delete mode using powerful rpm -e --nodeps mysql.
Meanwhile, if you have installed MySQL, there is also need to uninstall the configuration file, ensure that the entire system environment completely clean.

[root@hadoop01 opt]# find / -name mysql
/etc/selinux/targeted/active/modules/100/mysql
/var/lib/mysql
/var/lib/mysql/mysql
/usr/share/mysql

Here we direct use rm -rf to delete the corresponding folder, delete the MySQL configuration file /etc/my.cnf.

Check if installed MariaDB
check whether Linux install MariaDB, if it is CentOS7 version, should have built-in installation MariaDB.

[root@hadoop01 ~]# rpm -qa|grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64

As the installation file conflicts MySQL and MariaDB will, in order to ensure a smooth installation, where we unload MariaDB.

[root @ hadoop01 ~] # rpm -e mariadb-libs-5.5.56-2.el7.x86_64
Error: dependent detection failure:
libmysqlclient.so.18 () (64bit) is (installed) postfix-2: 2.10. 1-6.el7.x86_64 need
libmysqlclient.so.18 (64bit) (libmysqlclient_18) is (installed) postfix-2: 2.10.1-6.el7.x86_64 need
[root @ hadoop01 ~] # rpm -e - MariaDB-libs-5.5.56-2.el7.x86_64 nodeps
[root @ hadoop01 ~] # RPM -qa | grep MariaDB

Check the firewall is turned off
systemctl status firewalld.service # View firewall status
systemctl stop firewalld.service # turn off the firewall
systemctl disable firewalld.service # disable the firewall from the start

Download rpm installation package
here we use MySQL5.7 version.
Net official download path: https://dev.mysql.com/downloads/mysql/5.7.html#downloads

Extracting installation
using the tar command to unpack, get the following files after decompression, here briefly

File Name Description
mysql-community-client- client programs and tools
mysql-community-common- public file
mysql-community-devel- develop MySQL necessary header files and libraries
mysql-community-embedded-
embedded database
mysql-community- embedded-compat- embedded compatible shared library
mysql-community-embedded-devel-
embedded development library
MySQL Community Community-libs-- LIB library
MySQL-Community Community-libs-compat- LIB compatible shared library
mysql-community-server- server program and tools
mysql-community-test- test suite
described above the tape
is mounted items shall, where installed sequentially in the following order.

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

Under normal circumstances, these five steps can be performed normally, but the reason may be due to minimal installation of CentOS, when we execute
when the rpm -ivh mysql-community-server- 5.7.27-1.el7.x86_64.rpm , you may Tip dependent test failure.
Specific problem solving can refer to: MySQL5.7.27 rpm install server error resolved.
At this point, MySQL installation is successful, we start the MySQL service. To facilitate subsequent configuration.

systemctl status mysqld
systemctl start mysqld

Change Password
MySQL need to change your password when you first log on after a successful installation.
Let's get the initial default password related commands.

[root@hadoop01 opt]# grep 'temporary password' /var/log/mysqld.log
2019-07-24T13:21:36.471365Z 1 [Note] A temporary password is generated for root@localhost: 6eNegsd3U!aC

According to the provisional password MySQL

[root@hadoop01 opt]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.27

After a successful login, we modify the password. Note that, if our password is too simple, will be rejected MySQL. details as follows:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'root' ;
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Here we again set a relatively complex password (recommended combination of numbers plus the letter underlined), if you must set simple passwords, you can modify the configuration.
You can refer to: MySQL5.7 Set simple password
here without too much processing.

Set up remote login
after password change is successful, we need to set up remote login, convenient subsequent use.

mysql> use mysql;
mysql>update user set host='%' where user ='root' and host like 'localhost%';
mysql>flush privileges;

Note: After the modification done here need our permission to refresh, this step is very important, it can not be missed.

Guess you like

Origin blog.51cto.com/14510327/2434375