This article shares the MySQL 5.7 installation and configuration tutorial for your reference. The specific content is as follows Step 1: Get the MySQL YUM source Go to the MySQL official website to obtain the RPM package download address https://dev.mysql.com/downloads/repo/yum/ Click to download Right click and copy the link address https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm Get this. This is the rpm package of the Yum warehouse. It is actually a download address. Step 2: Download and install MySQL source First download the mysql source installation package [root@localhost ~]# wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm -bash: wget: command not found Let's install wget first yum -y install wget Then execute wgethttps://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm Install mysql source yum -y localinstall mysql57-community-release-el7-11.noarch.rpm Step 3: Install MySQL online yum -y install mysql-community-server If there are a lot of downloads, please wait a little longer. Step 4: Start the Mysql service systemctl start mysqld Step 5: Set up startup [root@localhost ~]# systemctl enable mysqld [root@localhost ~]# systemctl daemon-reload Step 6: Change the root local login password After mysql is installed, a temporary default password is generated for root in the /var/log/mysqld.log file. [root@localhost ~]# vi /var/log/mysqld.log The temporary password here is eMV.R#mWe3ha [root@localhost ~]# mysql -u root -p Enter password: Enter the temporary password to enter the mysql command line; mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Caofeng2012@'; Query OK, 0 rows affected (0.00 sec) Change the password to Caofeng2012@ (Note that the default password policy of MySQL 5.7 requires that the password must be a combination of uppercase and lowercase letters, numbers and special letters, and at least 8 characters) Step 7: Set up remote login Mysql does not allow remote login by default, we need to set it up and open port 3306 in the firewall; mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'Caofeng2012@' WITH GRANT OPTION; Query OK, 0 rows affected, 1 warning (0.01 sec) mysql> exit; Bye Exit next; [root@localhost ~]# firewall-cmd --zone=public --add-port=3306/tcp --permanent success [root@localhost ~]# firewall-cmd --reload success [root@localhost ~]# Open port 3306 Step 8: Configure the default encoding to utf8 Modify the /etc/my.cnf configuration file and add the encoding configuration under [mysqld] as follows: [mysqld] character_set_server=utf8 init_connect='SET NAMES utf8' [root@localhost ~]# vi /etc/my.cnf After editing and saving, restart the mysql service; [root@localhost ~]# systemctl restart mysqld [root@localhost ~]# Check out the following code: mysql> show variables like '%character%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+ 8 rows in set (0.00 sec) Step 9: Testing We use the local sqlyog to remotely connect to the mysql in the virtual machine OK. At this point, the Mysql installation and configuration is complete; The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: AsyncHooks asynchronous life cycle in Node8
>>: How to deal with the prompt "Operation not permitted" when deleting files in Linux
Table of contents 1. Introduction to docker-maven...
There are two ways to disable form submission in ...
Good morning everyone, I haven’t updated my artic...
Docker installation (Alibaba Cloud Server) Docker...
Remax is an open source framework developed by An...
MySQL 8 new features: My personal opinion on MySQ...
The earliest computers could only use ASCII chara...
1. Check the character set 1. Check the MYSQL dat...
You can install Docker and perform simple operati...
history route History mode refers to the mode of ...
1. flex-direction: (direction of element arrangem...
1. Location regular expression Let's take a l...
Judgment symbols are often used in MySQL, and not...
Introducing the Geo module of Nginx The geo direc...
This article example shares the specific code of ...