When I recently set up a PHP development environment, I encountered a problem that I had not encountered before. The downloaded decompressed version of MySQL5.7.10 database found that there was no data folder during configuration. What should I do? After thinking about it for a long time, I finally solved it. Now I will introduce the method and hope it will be helpful to those in need.
1. After downloading and decompressing, I found that there is no data folder. What should I do? I have checked a lot of posting methods online, but I still can’t understand them. New version It turns out that it has been changed and needs to be initialized. Here is a step-by-step guide.
2. Create a new data folder.
3. Open the configuration file my-default.ini and see that basedir and datadir are not opened. The previous There is #, and the path is also represented by "...".
##4. Remove the ones in front of basedir and datadir
#basedir adds the MySQL decompression path;
datadir adds the MySQL data folder path.
6. Add the Path variable value to the bin path you just copied. The specific method is: Open the computer desktop: Computer —>Right-click->Advanced system settings->Advanced->Environment variables (N)->Modify Path; just paste the copied address bar to the end. (Note here that different paths are separated by English ";") OK, exit.
#7. Open the dos interface. The specific method is: enter cmd.exe at the beginning and press Enter.
##8. This step is very important. To initialize MySQL, you need Enter the bin file in the MySQL decompression directory: The specific method is: Here is the path under the F drive as an example:
F:回车 F:cd phptools\MySQL\bin(回车) F:\phptools\MySQL\bin>mysqld --initialize-insecure --user=mysql(回车,这一步就是初始化)
When Service successfully installed appears, it means that the MySQL service has been installed and is about to be started. .
9.Start MySQL and enter it in the previous F:\phptools\MySQL\bin>:
net start mysql;
appears : The MySQL service started successfully, indicating that the configuration is complete this time.
10. The next step is to start the new version of MySQL. Open the dos interface and enter mysql -u root - p and then press Enter, you will be prompted to enter the password. If there is no password, press Enter.
11. Check the version. At this point, MySQL5.7.10 is installed.
Note
The new version of MySQL does not have data, you need to add it yourself, this requires initialization.
The above is the detailed content of Detailed installation tutorial for MySQL5.7.10 decompressed version. For more information, please follow other related articles on the PHP Chinese website!