How to install mysql 5.7.18 in Linux (CentOS 7) using YUM, centos5.7.18
MySQL is required for the project. because MySQL was previously installed on a windows server, there was basically no problem, but this time it was installed on the server. I am not familiar with installing the software on Linux, it took a lot of detours and delayed a lot of time. To avoid detours next time.
* *************************** The image cannot be inserted successfully, I don't know what is going on *********************************
I. Various environments:
Linux: CentOS Linux release 7.2.1511 (core)
Mysql version: community sercer 5.7.18
The yum installation package used:
Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent), RPM Package 25.1K Download(mysql57-community-release-el7-11.noarch.rpm)
Ii. Installation Steps
I downloaded the installation package on windows and then imported it to the server through xshell. Then install it on the mysql official website. No tutorials are reliable on the official website. Many tutorials have been searched on the Internet before. The installation methods of each tutorial are different. I am very depressed and fail. Finally, the installation was successful through the tutorials on the official website.
2.1 installation guide
After, select the generic binary version. Installing MySQL on Unix/Linux Using Generic Binaries
2.3 perform the preceding operations step by step.
Shell> yum search libaio # search for info (Mysql installation requires the libaio library, so you need to install the libaio Library first) shell> yum install libaio # install libraryshell> groupadd mysqlshell> useradd-r-g mysql-s/bin/false mysqlshell> cd/usr/localshell> tar zxvf/path/to/mysql-VERSION-OS.tar.gzshell> ln-s full-path-to-mysql-VERSION-OS mysqlshell> cd mysqlshell> mkdir mysql-filesshell> chmod 750 mysql-filesshell> chown-R mysql. shell> chgrp-R mysql. shell> bin/mysql_install_db -- user = mysql # MySQL 5.7.5 (choose mysql5.7.5 to use this command. If your mysql is 5.7.6 or above, you do not need to execute this command) shell> bin/mysqld -- initialize -- user = mysql # MySQL 5.7.6 and upshell> bin/mysql_ssl_rsa_setup # MySQL 5.7.6 and upshell> chown-R root. shell> chown-R mysql data mysql-filesshell> bin/mysqld_safe -- user = mysql & # Next command is optionalshell> cp support-files/mysql. server/etc/init. d/mysql. server
After all the preceding steps are completed, the installation is complete.
2.4 start the mysql service after installation
[Root @ *****/] # cd ~ # There is a problem here. I don't know how to switch to "~". Directory, no "~" before, Failed to start. I'm not sure whether the sytemctl start mysqld. service Command is entered incorrectly or not. [Root @ ***** ~] # Sytemctl start mysqld. service
Check whether startup is successful
[root@***** ~]# sytemctl status mysqld.service
If this ID is available, the instance is successfully started.
2.5 obtain the temporary password during installation to log on to mysql
grep'temporary password'/var/log/mysqld.log2017-05-10T00:55:46.982233Z 1 [Note] A temporary password is generated for root@localhost: 5C::+lMjqi+z
The temporary password is displayed in the red box.
2.5 log on with a temporary password
[root@****** ~]# mysql -uroot -pEnter password: Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.18
2.6 Change Password
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';Query OK, 0 rows affected (0.00 sec)
Note: The latest mysql has high security requirements. The password must contain special characters, uppercase and lowercase letters, and numbers. Otherwise, the password cannot be changed and an error is returned.
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
The above section describes how to use YUM to install mysql 5.7.18 in Linux (CentOS 7). If you have any questions, please leave a message, the editor will reply to you in a timely manner. Thank you very much for your support for the help House website!