Solve the problem that MySQL5.7 cannot log on without the data folder after installation, mysql5.7data
After the MySQL database is upgraded to version 5.7, it is somewhat different from the previous version. There is no data folder. We all know that the MySQL database files are saved in the data folder, some people on the Internet say that they have copied a data folder of version 5.6, which is not reliable. I also tried it and can log on, but cannot change the administrator password, the following is a standard solution.
After MySQL5.7 is installed, open the cmd command window and enter the bin directory in the MySQL installation directory. Then enter the following command and press Enter:
Copy codeThe Code is as follows:
Mysqld -- initialize-insecure -- user = mysql
After running the preceding command, MySQL creates a data folder and creates a default database. The logon username is root and the password is empty. The subsequent operations are the same as those of the previous version.
Articles you may be interested in:
- Mysql data folder location search
- Detailed description of mysql5.5 database data directory migration method
- Modify the MySQL 2003 database data directory in Windows Server 5.5