Problems encountered during installation of mysql 5.7.16 zip archive

There are two types of MySQL installation files, one is in msi format and the other is in zip format. If it is in msi format, you can directly click to install and install it according to the installation prompts it gives (I believe everyone can understand English prompts in English). Generally, MySQL will be installed in the directory C:\Program Files\MySQL\MySQL Server 5.6 Medium; the zip format is decompressed by itself. After decompression, MySQL can be used, but it needs to be configured.
After decompression, you can rename the folder and put it in a suitable location. Personally, it is recommended to rename the folder to MySQL Server 5.6 and put it in the C:\Program Files\MySQL path. Of course, you can put it anywhere you want.
MySQL 5.6 for Windows decompressed version configuration and installation
After completing the above steps, many users start to use MySQL, but the error shown in the figure will appear. This is due to no environment variables being configured. Configuring environment variables is very simple:
My Computer->Properties->Advanced->Environment Variables
Select PATH, and add: the path of your mysql bin folder (eg: C:\Program Files\MySQL\MySQL Server 5.6\ bin )
PATH=.......;C:\Program Files\MySQL\MySQL Server 5.6\bin (note that it is appended, not overwritten)
MySQL 5.6 for Windows decompressed version configuration Install
MySQL 5.6 for Windows decompressed version configuration Install
Don't start mysql after configuring the environment variables, we also need to modify the configuration file (if there is no configuration, the error in the figure will appear when starting!: Error 2 The system cannot find the file), mysql-5.6 .1X The default configuration file is in C:\Program Files\MySQL\MySQL Server 5.6\my-default.ini, or create a my.ini file by yourself,
and modify or add the configuration in it (as shown in the figure):
[mysqld]
basedir =C:\Program Files\MySQL\MySQL Server 5.6 (the directory where mysql is located)
datadir=C:\Program Files\MySQL\MySQL Server 5.6\data (the directory where mysql is located\data)
MySQL 5.6 for Windows decompressed version configuration to install
MySQL 5.6 for Windows decompressed version configuration and installation
MySQL 5.6 for Windows decompressed version configuration and installation Run cmd
as administrator (must be run as administrator, otherwise the permissions are not enough),
enter: cd C:\Program Files\MySQL\MySQL Server 5.6 \bin Enter the bin folder of mysql (regardless of whether the environment variables have been configured, enter the bin folder, otherwise the service will still report an error 2 after starting the service)
Enter mysqld -install (if you do not run as an administrator, it will be due to permissions Insufficient and error: Install/Remove of the Service Denied!)
Successful installation
MySQL 5.6 for Windows decompressed version configuration installation
MySQL 5.6 for Windows decompressed version configuration and installation After the
installation is successful, the service must be started. Continue to enter in cmd: net start mysql (as shown in the figure), the service is started successfully!
At this time, many people will have errors, please see Note:
Note: Error 2 and Error 1067 often appear at this time.
If "Error 2 The system cannot find the file" appears, check whether the configuration file has been modified or whether you have entered the bin directory to operate. If the configuration file has been modified correctly and entered the bin folder, you need to delete mysql first (input mysqld -remove) Reinstall (input mysqld -install);
if error 1067 occurs, it is the configuration file modification error, and confirm whether the configuration file is correct.
MySQL 5.6 for Windows decompressed version configuration and installation After the
service is successfully started, you can log in, as shown in the figure, enter mysql -u root -p (the first login has no password, just press Enter), the login is successful!
MySQL 5.6 for Windows decompressed version configuration installation

When starting mysql I encountered the following error
D:\Program Files\mysql\bin>net start mysql
MySQL service is starting.
MySQL service cannot be started.

The service did not report any errors.

Please type NET HELPMSG 3534 for more help.


Here's how to find it online:
After the MySQL database is upgraded to version 5.7, it is a bit different from the previous version. There is no data folder. We all know that MySQL database files are stored in the data folder. Some people on the Internet said to copy the data folder of version 5.6. This kind of statement is not reliable. I tried it too, and I can log in, but I cannot change the administrator password. The following is a standard solution.
After installing MySQL 5.7, open the cmd command window, enter the bin directory in the MySQL installation directory, and then enter the following command and press Enter:
mysqld --initialize-insecure --user=mysql
After executing the above command, MySQL It will build a data folder by itself, and build a default database. The login user name is root and the password is empty. The subsequent operations are the same as the previous version.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326482724&siteId=291194637