There are a lot of articles about MySQL installation on the Internet, but there are some problems in installing MySQL on your laptop today, just for record.
1. Download the zip package of MySQL. There are 32-bit and 64-bit versions of Windows on the official website https://dev.mysql.com/downloads/mysql/as required.
2. Unzip to the folder you refer to after downloading. This is my decompressed path.
3. Configuring environment variables is the same as configuring Java environment variables.
4. Change the database configuration file. Replicate my-default.ini in the root directory and rename it my.ini
Change the configuration inside, note that the file path inside must be double quotation marks in English.
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
[mysqld]
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
basedir ="D:\Program Files\mysql-5.6.36-winx64"
datadir ="D:\Program Files\mysql-5.6.36-winx64\data"
# port = .....
# server_id = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
#Service-side encoding
character-set-server=utf8
[client]
#Client-side encoding is best kept in line with server-side encoding
loose-default-character-set = utf8
[WinMySQLadmin]
Server = "D:\Program Files\mysql-5.6.36-winx64\bin\mysqld.exe"
5. Install MySQL service and switch dos window to MySQL bin directory to execute commands
mysqld -install
I have a problem. I found it on the Internet and said it lacks Microsoft Visual C++ 2010. Runtime library.
Okay, go to the Official Website and restart the service installation successfully.
Run services.msc to see the registered service, and then start the MySQL service.
So far, our MySQL server has been installed.
6. Log on to MySQL server and reset your password.
Because the default user name is root password, the empty command MySQL u root p can be logged in directly by entering the password at the return prompt. At this point, the green version of mysql-5.6.36-winx64 was installed successfully.
Let's change the default password, or in the bin command directory, use the mysqladmin.exe command to change the password.
mysqladmin-u root-p password 123456//123456 is a new password, enter the password according to the return prompt, then it is the original password, the original password is empty and directly return to the car is modified successfully.
Log in with a new password
It is inconvenient to operate under the black window. In practice, most of the visualization tools of MySQL are navicat for mysql.