Mysql 5.7.16 installation and configuration method graphic tutorial, mysql5.7.16
Based on the information on the Internet, I personally installed MySQL. The installation version is win7x64 5.7.16.
The following problems occur during installation:
"Mysql service cannot start the service and no error is reported"
1. Download:
Address: http://dev.mysql.com/downloads/mysql/
2. installation:
The ZIP Archive version is free of installation. You just need to decompress the package. No installation is required. I put it on drive D.
3. Configuration:
That isThe origin of my. ini file.
Copy the my-default.ini file and rename my. ini, and then replace it with the following code: (change the D: \ mysql \ mysql-5.6.17-winx64 to your own software path, save)
[Mysql] # set the default character set of the mysql client default-character-set = utf8 [mysqld] # set port 3306 to port 3306 # set the mysql installation directory basedir = D: \ mysql \ mysql-5.6.17-winx64 # Set the mysql database data storage directory datadir = D: \ mysql \ mysql-5.6.17-winx64 \ data # maximum number of connections allowed max_connections = 200 # the character set used by the server defaults to the 8-bit latin1 character set character-set-server = utf8 # default storage engine default-storage-engine = INNODB
4. Install and start the mysql service:
That isThe origin of the data folder.
Open the cmd window as an administrator and switch the directory to the bin directory of the decompressed file.
Enter mysqld install and press enter to run the command.
Then, enter net start mysql to start the service.
Error !!!
"The server cannot be started and no error is reported ."
Then...
Enter mysqld -- initialize-insecure -- user = mysql
(After executing the preceding command, MySQL creates a data folder and creates a default database. The logon username is root and the password is blank)
Start again: Enter net start mysql to start the service. OK is successful.
As shown in my figure.
5. Open the MySQL database to log on to the MySQL database.
In command mode, switch the directory to your \ bin directory.
Enter mysql-u root-p. The default password is no. Press enter to enter. root is the user name,
(To do this, you must have enabled the MySQL service. Otherwise, it won't work .)
Exit and press Enter. Remember that closing the cmd window does not exit. You need to enter exit to exit.
In addition:
1. How to manually open the MySQL Service,
Details
2. How the task manager opens the serviceIs as follows:
Configure environment variables and open the mysql database through the command line.
The following is what is configured in my Path environment variable. Obviously, my last one is not ended with a semicolon.
When you want to add the MySQL environment variable to this, you must add the semicolon in front. And then add.
Copy codeThe Code is as follows: C: \ ProgramData \ Oracle \ Java \ javapath; C: \ Program Files (x86) \ NVIDIA Corporation \ PhysX \ Common; % SystemRoot % \ system32; % SystemRoot %; % SystemRoot % \ System32 \ Wbem; % SYSTEMROOT % \ System32 \ WindowsPowerShell \ v1.0 \; % JAVA_HOME % \ bin; % JAVA_HOME % \ jre \ bin; C: \ android-sdk-windows \ tools; C: \ Program Files \ TortoiseSVN \ bin; % MAVEN_HOME % \ bin; % M2_HOME % \ bin; D: \ Program Files \ nodejs \
After the environment variables are configured, you can directly run cmd without entering the directory, and then enter mysql-u root-p to open the MySQL database. Of course, your service must be started first, otherwise, it will not work.
Now the environment is good, but I don't know how to write statements. Oh, sorry.
The above is my configuration environment record.
A certain degree of experience, coupled with your own practices. Leave this record for future use.
A simple statement:
(This figure is special because the command line I used in the terminal that comes with the terminate editor in the intellij idea editor is similar to your cmd. It can be seen from the side that this editor is still a bit cool, everything .)
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.