windows free installation version mysql

Many students are entangled in the installation of mysql. Previously, a version of the installation tutorial under Linux was released, and now a version of the installation tutorial under Windows is added.

1. First download our free installation version mysql ()

2. Unzip the file to the specified directory (you want to put it in mysql)

3. Configure mysql environment variables

(1) Right-click this computer -> Properties -> Advanced System Settings (Advanced) -> Environment Variables
      Click the New button under System Variables and
      enter the variable name: MYSQL_HOME
      Enter the variable value: D:\mysql-5.7.22 #Variable
      value It is the custom decompression directory of mysql

(2) Select Path in the system variable and
      click the edit button
      to add the variable value to the variable value: %MYSQL_HOME%\bin
      Note that this variable is added after the original variable value, separated by ;, the original variable value cannot be deleted. The details are shown in the figure below:

4. Add a my.ini file to the unzipped mysql file

In the path of D:\mysql-5.7.22, create a new txt text, then modify the extension, and name it my.ini, put the following code in the file ( after the following settings, the subsequent establishment of the database will not There are problems with Chinese garbled and Chinese cannot be inserted ):

####################配置文件开始################### # For advice on how to change settings please see # http://dev.mysql.com/doc/refman/5.7/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.  [client]  default-character-set=utf8    [mysqld] character-set-server=utf8  port=3306  basedir  ="D:\mysql-5.7.22\"  datadir  ="D:\mysql-5.7.22\data\"  tmpdir   ="D:\mysql-5.7.22\data\"  socket   ="D:\mysql-5.7.22\data\mysql.sock"  log-error="D:\mysql-5.7.22\data\mysql_error.log"   #server_id = 2 #skip-locking    max_connections=100  table_open_cache=256  query_cache_size=1M    tmp_table_size=32M  thread_cache_size=8    innodb_data_home_dir="D:\mysql-5.7.22\data\"  innodb_flush_log_at_trx_commit =1  innodb_log_buffer_size=128M  innodb_buffer_pool_size=128M  innodb_log_file_size=10M  innodb_thread_concurrency=16  innodb-autoextend-increment=1000  join_buffer_size = 128M  sort_buffer_size = 32M  read_rnd_buffer_size = 32M  max_allowed_packet = 32M  explicit_defaults_for_timestamp=true  sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES####################配置文件结束###################

5. Install mysql service and log in to mysql

First, open cmd as an administrator, and then perform the following steps:

(1) Use the command: mysqld --initialize-insecure, this command will generate a passwordless root user. The command mysqld --initialize automatically generates the root user with a random password. It is recommended to use the mysqld --initialize-insecure command to generate a passwordless root user.

Tip: After using the mysqld --initialize-insecure command, the result: Because there is no data folder in the decompressed mysql folder, the data folder will be automatically generated after the command is executed here

(2) Next, use the command: mysqld --install to install the mysql service (mysql remove is to uninstall the mysql service)

(3) Use command to start mysql service: net start mysql, open mysql service

(4) Use the command: first enter mysql -u root -p, enter mysql to enter mysql, enter again to enter (note that there is no need to enter a password)

If you use the mysqld --initialize-insecure command in the first step, after the installation is successful, the mysql root account password is empty. Now you can modify the password as shown below:

This completes the opening of the background management page function.

For more programming support, please pay attention to my public account "coder trainee"