yum install MySQL and cluster configuration

In CentOS7 default installed MariaDB, MySQL is the branch, but the need for, or to install MySQL in the system, and after the installation is complete, you can directly overwrite MariaDB.
1 Download and install the MySQL official Repository Yum
wget -c -i http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
above command directly download the installation of yum Repository, about 25KB look, then you can directly install yum.
yum -y install mysql57-community-release -el7-10.noarch.rpm
then began installing MySQL server.
yum -y install mysql-community-server
This step may take some time, it will overwrite mariadb before the installation is complete.
yum install MySQL and cluster configuration
At this point MySQL installation is complete, then some set of MySQL.
2 MySQL database settings
first start MySQL
systemctl Start mysqld.service
view MySQL running state, running state is shown:
yum install MySQL and cluster configuration
At this point MySQL has started running, but in order to enter MySQL must first find out the root password at this time, with the following command you can find the password in the log file:
yum install MySQL and cluster configuration
the following command into the database:
MySQL -p-uroot-
yum install MySQL and cluster configuration
enter the initial password, this time can not do anything, because to operate after MySQL database default password must be changed:
ALTER USER 'root' @ 'localhost ' IDENTIFIED BY 'new password';
There is a problem, when the new password settings if set too simple to be given:
yum install MySQL and cluster configuration
first need to set the authentication strength level of the password, set global parameters validate_password_policy is LOW can,
enter the statement set value "set global validate_password_policy = LOW;" set value for
yum install MySQL and cluster configuration
the current password length is 8, if not mind would not modified, according to general terms, the password is set to 6, provided global validate_password_length parameter to 6,
the input set values in the statement "set global validate_password_length = 6;" for setting the value
yum install MySQL and cluster configuration
can now be provided for a simple password mysql, as long as the length of six to meet,
the ALTER the USER 'the root' @ 'localhost' the IDENTIFIED BY 'a @ 123456';
yum install MySQL and cluster configuration
Note: the default password minimum length is 4, each digit a + a + a special character by the large / small letter,
as long as the set password length is less than 3, are automatically set a value of 4
is provided remote login (I use Navicat)
yum install MySQL and cluster configuration
resolved
yum install MySQL and cluster configuration
detection
yum install MySQL and cluster configuration
Note: If you are not a production environment Is intended to enable root remote login (security issues)

But this time there is a problem, because the Yum Repository installation, yum after each operation will automatically update, you need to uninstall this:
yum -y the Remove mysql57-Community Community-Release-el7-10.noarch
this database installation is complete a.

Guess you like

Origin blog.51cto.com/10158955/2440446