Whim to install a CDH cluster on a virtual machine, install MySQL in the middle, and install the process notes again
MySQL official website: http://www.mysql.com
I installed the Centos7,mysql-5.7.13-1.el7.x86_64.rpm-bundle.tar
The installation method of RPM is used.
1, need to uninstall the system comes with Mariadb-lib
[Email protected] cm]# Rpm-qa | grep mariadb
Mariadb-libs-5.5.41-2.el7_0.x86_64
RPM-E mariadb-libs-5.5.41-2.el7_0.x86_64--nodeps
2. Download your own version of the MySQL tar package
3. Upload the downloaded package to the server
4. Decompression
Tar xvf Mysql-5.7.13-1.el7.x86_64.rpm-bundle.tar
5, extract out there are 12 RPM package, but we can not use so much, only need to install four of them is enough
RPM-IVH mysql-community-common-5.7.13-1.el7.x86_64.rpm
RPM-IVH mysql-community-libs-5.7.13-1.el7.x86_64.rpm-(dependent on common)
RPM-IVH mysql-community-client-5.7.13-1.el7.x86_64.rpm-(dependent on Libs)
RPM-IVH mysql-community-server-5.7.13-1.el7.x86_64.rpm-(dependent on client, common)
6, initialize the database, mainly in order to initialize the root user's password, convenient for us to login, because this version of I did not find the command to enter the Safe mode (previous version of the command Mysql_safe)
Mysqld--initialize
After executing this command, the/var/lib/mysql directory is initialized and the initialized password is placed in the/var/log/mysqld.log
(or you can use this command to initialize or mysql_install_db--datadir=/var/lib/mysql must specify the initialized directory, the ~/.mysql_secret password file will be generated after execution)
7, the initialization of the generated directory to the right, because it was initialized with the root user, so the directory owner or root, but that directory is for the MySQL user, the permissions are not enough error
Chown Mysql:mysql-r/var/lib/mysql
8. Start the MySQL server
Systemctl Start Mysqld.service
9. Login to the root user
Mysql-uroot-p ' files found inside the password '
10. Reset the root password of MySQL
Set Password=password (' root ');
11. Empowering Remote Users
GRANT all privileges on * * to ' root ' @ '% ' identified by ' root ' with GRANT OPTION;
Remote empowerment, * * represents all databases, all table root represents the remote login user % represents that all hosts can use this user to log in behind the root is the remote login password
12. Refresh Permissions:
Flush privileges;
Installation Complete
installation of MySQL