Configuring MySQL installation

  1. Prepare the network YUM source
[root@localhost ~]# yum install -y HTTPD PHP php-mysqlnd php-xml php-json createrepo # yum install -y HTTPD PHP php-mysqlnd php-xml php-json createrepo # [root@localhost ~]# systemctl start httpd [root@localhost ~]# systemctl enable httpd [root@localhost ~]# mkdir /var/www/html/mysql [root@localhost ~]# tar xf mysql-5.7.17.tar -c /var/www/html/mysql/ [root@localhost ~]# CD /var/www/html/mysql/ [root@localhost mysql]# createrepo -d .Copy the code
  1. Install and start mysql-community 5.7
/ root @ localhost ~ # vim/etc/yum repos. D/mysql. Repo/mysql name = mysql5.7 baseurl = http:// you host IP address/mysql enabled = 1 gpgcheck=0 [root@localhost ~]# yum install mysql-community* [root@localhost ~]# systemctl start mysqld [root@localhost ~]# systemctl enable mysqldCopy the code
  1. Changing the initial password (must be changed)
#When the Mysql service is started, a random password is automatically generated and written to the mysqld.log.
#View the generated password in mysqld.log
[root@localhost ~]# grep -i password /var/log/mysqld.log
#Change the password of user root to 20210505a@
[root@localhost ~]# mysqladmin -uroot -p'A8cCwrjefY(v' password 20210505aA@
Copy the code

Install graphic tools

  1. The installation
#Install HTTPD on the mysql server and start it[root@mysql1 ~]# yum install -y php php-mysqlnd php-xml php-json [root@mysql1 ~]# systemctl start httpd [root@mysql1 ~]#  systemctl enable httpd
#Deploy phpMyAdmin to manage the mysql database through a Web page[root@mysql1 ~]# tar xf phpmyadmin-2.11.11-all-languages.tar. gz [root@mysql1 ~]# mv phpmyadmin-2.11.11-all-languages.tar. gz [root@mysql1 ~]# mv phpmyadmin-2.11.11-all-languages /var/www/html/mysqladmin [root@localhost ~]# cd /var/www/html/mysqladmin [root@localhost mysqladmin]# cp [root@localhost mysqladmin]# vim config.inc. PHP # create config file [root@localhost mysqladmin]# vim config.inc$cfg['blowfish_secret'] = 'hello';   # add some random characters
Copy the code
  1. Go to http://host IP address /mysqladmin. The user name and password are root and password for logging in to mysql.