To prevent licensing mode from starting
Edit/ETC/MY.CNF and add the following:
Linux Environment: VI/ETC/MY.CNF
Add the following two lines to the [MySQL (and PHP collocation best combination) d] Configuration segment:
User=mysql
Skip-grant-tables
Save to exit Edit.
Restart Mysqld.
Service mysqld Restart
Use MySQL password-free connection, change password and password expiration flag;
[[email protected] ~]# Mysqlwelcome toThe MySQL Monitor. CommandsEnd with;or\g.your MySQL Connection ID is 3Server Version:5.7. -MySQL Community Server (GPL) Copyright (c) -, ., Oracleand/orits affiliates. Allrights reserved. Oracle isA registered trademark ofOracle Corporationand/oritsaffiliates. Names may trademarks oftheir respectiveowners. Type'Help ;' or '\h' forHelp. Type'\c' toClear the Currentinput Statement.mysql> Select User(); MySQL>show databases;+--------------------+| Database |+--------------------+|Information_schema||Mysql||Performance_schema||Sys|+--------------------+4Rowsinch Set(0.00sec) MySQL> Select User();+--------+| User()|+--------+|[Email protected]|+--------+1Rowinch Set(0.00sec) MySQL>UPDATEMysql.User SETAuthentication_string=PASSWORD ('[Email protected]!'), password_expired='N' where USER='Root'; Query OK,1Rows affected,0Warning (0.00sec) MySQL> ExitBye
Normal connection:
[Email protected] ~]# mysql-u root-penter password:welcome to the MySQL monitor. Commands End With; or \g.your MySQL connection ID is 3Server version:5.7.16 mysql Community Server (GPL) Copyright (c), Oracle and /or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names trademarks of their respectiveowners. Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.mysql>
Installation of MySQL 5.7 in CentOS