Installing MySQL under CentOS redhat
This article installs MySQL5.7 using VM virtual machine RHEL7 operating system, FTP file transfer is FileZilla3.27, remote connection xssh5.0
1 login MySQL website download mysql, https://dev.mysql.com/downloads/mysql/here is using RPM package installation, download the corresponding community version of the RPM package, note that you need to log in to Oracle to download, Can not download only mysql-server server, because there is a dependency, you have to download the following five packages
2 See if the system is already installed MySQL no, code Rpm-aq | grep MySQL, if the old version will need to unload mariadb like below uninstall. MARIADB is the RHEL system has been installed, need to uninstall, Baidu Encyclopedia is said, MARIADB is also considered as an open source database MySQL alternative, install MySQL may conflict, view mariadb, code RPM-QA | grep mariadb, Baidu Encyclopedia about mariadb Https://baike.baidu.com/item/mariaDB/6466119?fr=aladdin
3 uninstall mariadb, with R rpm-e Uninstall, because there is a dependency, the end plus--nodeps regardless of dependency forced unloading, (note is two English input method under the horizontal bar), three are to uninstall, because I uninstalled the first so the hint is wrong
Code RPM-E mariadb-libs-5.5.52-1.el7.x86_64--nodeps
RPM-E mariadb-server-5.5.52-1.el7.x86_64--nodeps
RPM-E mariadb-5.5.52-1.el7.x86_64--nodeps
4 some MySQL installation tutorials, created users and groups, but in the current version, the official documentation has not been explained that it is necessary to create a MySQL group and a MySQL user, so you can not create groups and users, pay attention to switch the root user under, enter/usr/local, code CD/USR /local
5 creating MySQL folder code mkdir mysql
6 The Windows system downloaded 5 files with FileZilla to the MySQL directory, FileZilla use, official website download https://filezilla-project.org/or Baidu software download, after installation, In the Linux system to open the terminal to view the host IP, code ifconfig, the IP username password port (default 22) input, and then select the directory file transfer just fine
5 MySQL installation files
7 start to install MySQL database now, take note of the official documentation that the individual files are dependent and must be installed in the following order, you can also try other sequences to see the wrong tips
Installation order
mysql-community-common-5.7.18-1.el7.x86_64.rpm
mysql-community-libs-5.7.18-1.el7.x86_64.rpm
mysql-community-client-5.7.18-1.el7.x86_64.rpm
imysql-community-server-5.7.18-1.el7.x86_64.rpm
mysql-community-devel-5.7.18-1.el7.x86_64.rpm
Code RPM-IVH mysql-community-common-5.7.18-1.el7.x86_64.rpm
Code RPM-IVH mysql-community-libs-5.7.18-1.el7.x86_64.rpm
Code RPM-IVH mysql-community-client-5.7.18-1.el7.x86_64.rpm
Code RPM-IVH MYSQL-COMMUNITY-SERVER-5.7.18-1.EL7.X86_64.RPM Server installation time is a bit long, wait a minute
Code RPM-IVH mysql-community-devel-5.7.18-1.el7.x86_64.rpm
8 The installation is finished, but it is not finished, we first look at the official installation documents, PS English is how important, or other software installation or error, it is best to go to the official website or English forum, to see the offical documents or forum posts, help is very large, install the document address https:// Dev.mysql.com/doc/refman/5.7/en/linux-installation-rpm.html
Probably said that, after the installation of MySQL is not automatically start, but after the first boot, the boot is self-starting, no first start, but also no password. When you start the MySQL server for the first time, MySQL himself will do a lot of things, one of the important is the initial password, A Superuseraccount is ‘root‘@‘localhost‘
created. Apassword for the superuser are set and stored in the error log file. When you do not start MySQL before you install it, you execute vim/var/log/mysql.log you will find that the file is empty or a new file, so start MySQL now.
9 starting the MySQL service code services mysqld start
10 Check to see if the MySQL service has started code service MYSQLD status (Centos7 already using SYSTEMCTL management mechanism) The following is a success.
11 Start after the password is initialized, check the password code into the/var/log/directory can be directly vim mysqld.log view or directly Vim/var/log/mysqld.log view PS is Mysqld.log not mysq L.log exit Vim, press ESC first, then press SHIFT+Q, then enter q! to
12 log in to MySQL, log in is not authorized any action, must change the password
Login Code mysql-u root-p return let you enter the password, enter the password when careful, the password is very messy
13 Change Password
Code set password for ' root ' @ ' localhost ' = ' newpasswd ' newpasswd is the new password you set, password must meet requirements, eight digits and above, need case, number and special characters
14 to this, even if the MySQL database installation is complete, the next is the long way to learn MySQL!
Linux Rhel7 under MySQL5.7 How to install documents in detail