This article tests the environment: CentOS 7 64-bit Minimal MySQL 5.7 Configure yum source Find the yum source rpm installation package at https://dev.mysql.com/downloads/repo/yum/ rpm installation package Install mysql source # Download shell> wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm # Install mysql source shell> yum localinstall mysql57-community-release-el7-11.noarch.rpm Use the following command to check whether the mysql source is installed successfully shell> yum repolist enabled | grep "mysql.*-community.*" mysql source installed successfully Install MySQL Install using the yum install command Start MySQL Service In CentOS 7, the new command to start/stop the service is systemctl start|stop Use systemctl status to view MySQL status MySQL startup status Set startup Change the root local account password After mysql is installed, the generated default password is in the /var/log/mysqld.log file. Use the grep command to find the password in the log. View Temporary Password After logging in for the first time with the initial password, use the following command to change the password or Later, change the password through the update set statement Note: MySQL 5.7 has a password security check plug-in (validate_password) installed by default. The default password check policy requires that the password must contain uppercase and lowercase letters, numbers, and special symbols, and the length must not be less than 8 characters. Otherwise, the error ERROR 1819 (HY000): Your password does not satisfy the current policy requirements will be displayed. View the detailed password policy on the MySQL official website Adding a remote login user By default, only the root account is allowed to log in locally. If you want to connect to MySQL on another machine, you must add an account that allows remote connections. or Add an account that allows remote connections mysql> GRANT ALL PRIVILEGES ON *.* TO 'zhangsan'@'%' IDENTIFIED BY 'Zhangsan2018!' WITH GRANT OPTION;
Set the default encoding to utf8 After MySQL is installed, it does not support Chinese by default, so the encoding needs to be modified. Copy the code as follows: [mysqld] character-set-server=utf8 [client] default-character-set=utf8 [mysql] default-character-set=utf8 Restart the mysql service and query the encoding. You can see it has been changed.
Configuration file: /etc/my.cnf You may also be interested in:
|
<<: How to move a red rectangle with the mouse in Linux character terminal
>>: What scenarios are not suitable for JS arrow functions?
There are many reasons why an application is as s...
Table of contents 1. What is Docker Compose and h...
<br />Without any warning, I saw news on cnB...
Table of contents Pygame functions used Creating ...
I encountered such a problem when doing the writte...
Test project: react-demo Clone your react-demo pr...
Summarize This article ends here. I hope it can b...
This article mainly introduces the sql script fun...
What is HTML? To put it simply: HTML is used to m...
Table of contents 1. How are structures stored in...
First: via text/HTML var txt1="<h1>Tex...
This article uses examples to illustrate the tabl...
There are many loop statements in JavaScript, inc...
Why do we need virtual dom? Virtual DOM is design...
Upgrade process: Original system: CentOS7.3 [root...