mysql-8.0.25-winx64 download and install (under win10)

1. Download mysql

https://dev.mysql.com/downloads/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)

[mysqld]
# Set 3306 port
port=3306
# Set mysql installation directory
basedir=D:\mysql-8.0.25-winx64

# Set the storage directory for the data of the mysql database
 datadir=D:\mysql-8.0.25-winx64\data
# Allow the maximum number of connections
max_connections=200
# Allow the number of connection failures
max_connect_errors=10
# The character set used by the server defaults to UTF8
character-set-server=utf8
# The default storage engine that will be used when creating new tables
default-storage-engine=INNODB
# The "mysql_native_password" plug-in authentication is used by default
#mysql_native_password
default_authentication_plugin=mysql_native_password
default-time-zone='+08:00'
#sql_mode="STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

[mysql]
# Set the default character set of the mysql client
default-character-set=utf8
[client]
# Set the port used by default when the mysql client connects to the server
port=3306
default-character-set=utf8

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

note:

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)