mysql 5.7. 5 m15 winx64. zip Installation Tutorial

  • 2021-08-21 21:44:48
  • OfStack

How to install and configure mysql-5. 7.5-m15-winx64 under win7 64-bit

It has been a long time since MySQL was last installed. These steps may be forgotten. Make a simple record. (Refer to some blogs on the Internet.)

1. mysql-5. 7.5-m15-winx64. zip Download

Download address of official website: http://cdn.mysql.com/Downloads/MySQL-5. 7/mysql-5. 7.5-m15-winx64. zip

2. Extract to D:\ MySqlDataBase

3. Create a new my. ini configuration file under D:\ MySqlDataBase\ mysql-5. 7.5-m15-winx64

The contents are as follows:


#################### Configuration file start ###################
 # 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]
 port=3306
 basedir ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/"
 datadir ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/"
 tmpdir ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/"
 socket ="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/data/mysql.sock"
 log-error="D:\MySqlDataBase\mysql-5.7.5-m15-winx64/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:\MySqlDataBase\mysql-5.7.5-m15-winx64/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="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
 #sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

#################### End of configuration file ###################

Focus on the following configuration, where the directory name of datadir must be: D:\ MySqlDataBase\ mysql-5. 7.5-m15-winx64/data/.

4. In the windows system environment variable path, add the following

D:\ mysql\ mysql-5. 7.5-m15-winx64\ bin; (Note the semicolon)

5. Register mysql as windows system service

This is done by executing the following command on the command line (which requires running the command line as an administrator):

You need to switch to the bin directory, otherwise the service directory is specified as C:\ Program Files\ MySQL\ MySQL Server 5.7\ mysqld

Add service command: mysqld install MySQL-defaults-file= "D:\ mysql\ mysql-5. 7.5-m15-winx64\ my.ini"

The remove service command is: mysqld remove

6. After Step 5 succeeds, open System Services Management

You can see the mysql system service

Start mysql at the command line. The command is: net start mysql

The Close mysql command is: net stop mysql

7. Change the password of root to wenthink

Command line execution: mysql uroot


mysql>show databases;

mysql>use mysql;
mysql> UPDATE user SET password=PASSWORD('wenthink') WHERE user='root';

    mysql> FLUSH PRIVILEGES;

mysql> QUIT

Remote login configuration

Allow root users to log in remotely anywhere and have any operation rights for all libraries, as follows:

1) Log in to mysql using root user on this machine first:

Command line execution: mysql-u root-p

Enter the password (the password set in step 7): wenthink

2) Perform authorization operations:

mysql > GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

Overload the authorization table:

mysql > FLUSH PRIVILEGES;

Exit mysql: quit


Related articles: