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?
Preface I believe that the syntax of MySQL is not...
Table of contents 01 What is Kubernetes? 02 The d...
We may have a question: After we install MySQL lo...
Table of contents 1. child_process 2. Command exe...
This article shares with you how to use Vue to dr...
Even though it's not Halloween, it's wort...
Overview Today we will mainly share how to config...
While the paperless world has not yet emerged, mo...
I believe that many friends who are new to web pag...
Table of contents 1. Offline installation 2. Onli...
question After the company migrated the server, t...
The following error message appears when installi...
Greek letters are a very commonly used series of ...
The installation tutorial of mysql5.7.17 is share...
Preface I made a loading style component before. ...