1. Download mysql
2. After downloading, configure the mysql installation path to the Path variable in the system variables
3. Create a my.ini file that configures mysql
The my.ini file is in the mysql installation directory, such as my full path
The content of the my.ini file is as follows (copy directly but basedir and datadir should be modified to your own installation directory, and the data folder in datadir should not be created manually)
# Set 3306 port
# Set mysql installation directory
# Set the storage directory for the data of the mysql database
# Allow the maximum number of connections
# Allow the number of connection failures
# The character set used by the server defaults to UTF8
# The default storage engine that will be used when creating new tables
# The "mysql_native_password" plug-in authentication is used by default
# Set the default character set of the mysql client
# Set the port used by default when the mysql client connects to the server
4. Initialize mysql
Execute the --initialize command. Open the cmd command window as an administrator. Enter: mysqld --initialize --user=mysql --console and press Enter. The red box below is the command you executed. Note that the green box you get is your initial password. This must be remembered, you can copy it to the text and save it.
Execute the mysqld --install command
View the service service in the task manager (the service is stopped at this time)
Start the mysql service
Execute net start mysql to start the service. Only when the service is turned on can you link and operate the database. See the following display, the mysql server has been started at this time.
5. Command line login to mysql
After starting the service, continue to execute mysql -u root -p, you will be asked to enter the password at this time. At this time, it is necessary to copy the default password given to you by mysql above. Enter the password and press Enter.
After entering the password and pressing Enter, when the word Welcome... is displayed, congratulations! At this time, the mysql data was really successfully installed. Or green installation, zip decompression version, the kind that you don't need to uninstall when you don't want it.
Don't forget, all you have to do at this time is to change the password. You can't always use the particularly complicated default password that mysql gives you, right?
Execute set password='123'; At this time, the password is changed to the number 123. Pay attention to the semicolon when executing the command, because the data command is always operated.
At this time, you can execute the quit command to exit the database, and then re-execute the previous step mysql -u root -p and enter the password to log in to the database again. This is all about your database. The account is root and the password is 123. If you only use this database for development, you don't need to set a difficult password, because if you forget the password, there is only one way left. Uninstall completely and reinstall mysql.
6. Log in to mysql with the client
For formal database operations, we generally do not use the command line, but generally use the sql client tool to operate. The more useful sql client tool is recommended here. SQL Developer
Download and install SQL Developer (including operation mysql) as follows
Download, install and use reference https://www.cnblogs.com/jepson6669/p/9429763.html
The mysql jdbc needed for the use process can be obtained from the source address of the Alibaba Cloud central warehouse
Alibaba Cloud central warehouse source address https://repo1.maven.org/maven2/?spm=a2c40.maven_devops2020_goldlog_.0.0.275c3054D5vjqN
mysql jdbc address https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.25/ (after downloading the jdbc jar, it can be placed in the mysql installation directory)
Alibaba Cloud cloud effective Maven address https://maven.aliyun.com/mvn/guide (Alibaba Cloud all maven warehouse navigation address)