Before doing so, turn off the firewall
shell > wget http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm shell > yum localinstall -y mysql57-community-release-el7-7.noarch.rpm shell > yum install -y mysql-community-server shell > vi /etc/my.cnf Skip-grant-tables skip-networking shell > systemctl start mysqld.service shell > mysql -uroot -p shell > update mysql.userset authentication_string=password("yourpassword") where user="root" and Host="localhost";
shell > flush privileges;
shell > quit;
shell > systemctl restart mysqld;
use mysql;
GRANT ALL PRIVILEGES ON *.* TO 'root'@The '%' IDENTIFIED BY 'Your password' WITH GRANT OPTION;
Copy the code
Note: ‘%’ stands for any address, IP can also be specified
Note: Modify the mysql configuration file
vim /etc/my.cnf
Modify the [mysqld]
character-set-server=utf8
Collation-server = UTf8_general_CI Parameter description
Haracter_set_client: Character set from which the client requests data.
Character_set_connection: Character set to which data is received from the client and then transmitted.
Character_set_database: The character set of the default database, which remains the same regardless of how the default database is changed; If there is no default database, you do not need to set the character_set_server character set.
Character_set_filesystem: Converts the character_set_client file name to the character_set_FILESYSTEM character set (binary by default).
Character_set_results: Character set of the result set.
Character_set_server: Default character set for the database server.
Character_set_system: This value is always UTF8 and does not need to be set. The character set of the storage system metadata.
4.2 Modifying the mysql Configuration File (Case Sensitive)
Lower_case_table_names: 0: case sensitive 1: case insensitive