MySQL decompression version of the configuration has been very convenient, but also because of the official continuous optimization, resulting in the traditional routines have been modified again and again. Also let the new like me hit a big wall.
Note: This blog applies to mysql5.7.10~5.7.15, if the version is too far, please be careful. 】
First, the problem: MySQL installation configuration completed and successfully started the service, the original thought can be directly executed
Mysql
Or
Mysql-uroot-p
method to log in as a super administrator. However, the current version of MySQL does not already support password-free logins. So it's an error.
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)
Workaround: In fact, during the installation process, MySQL has generated a string as root password, this string can be generated during the installation process:
The {host name}.err file found in the. \mysql-5.7.15-winx64\data directory:
Search in this log file: [email protected] to find
Mine is:
2016-10-28t19:00:31.400308z 0 [Warning] Gtid table is not a ready-to-be used. Table ' mysql.gtid_executed ' cannot be opened.
2016-10-28t19:00:34.001409z 1 [Note] A temporary password is generated for [email protected]: Lx (R (y8hzhit
2016-10-28t19:01:20.927534z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp serve
This "Lx" (R (Y8hzhit) is the root password that is executed at login time.
Mysql-u root-p
Then enter this password to do so. Linking to a database allows you to arbitrarily change or add users.
Mysql 5.7.10 or later installation of Tai Hang