Green version MYSQL configuration installation

mysql-5.7.17-winx64 installation-free version, installation and configuration in win10 environment

Download address: http://dev.mysql.com/downloads/file/?id=467269
 
1. Unzip to a custom directory: I unzip it to the D drive 2. Copy my -  
 
default.ini and rename my.ini to  
configure as follows:


[mysql]
# Set the default character set of the mysql client
default-character-set=utf8

[mysqld] #Installation
directory
basedir = D:\mysql- 5.7.17-winx64 #Data
storage directory The data directory is to be created separately, remember it is an empty folder
datadir =D:\mysql-5.7.17-winx64\data #Port
port
= 3306
# The default character set used by the server is 8-bit encoded latin1 character set
character-set-server=utf8
# The default storage engine that will be used when creating a new table
default-storage-engine=INNODB
# The maximum number of connections
max_connections = 100
# The maximum limit of a single memory table
max_heap_table_size = 64M
#Sort buffer size allocated for each thread
sort_buffer_size = 8M #The buffer size
of join table operation, set according to the actual business, default 8M
join_buffer_size = 32M
# sql query cache, if the submitted query is the same as a query in several times , and exists in the query cache, then directly return the result in the cache
query_cache_size = 64M
3. In My Computer--Properties--Environment Variable Settings
Add the environment variable MYSQL_HOME = D:\mysql-5.7.17-winx64
and then in the path Add %MYSQL_HOME%\bin later
4. After opening the cmd window as an administrator, switch the directory to the bin directory where you unzipped the file and
  execute mysqld -install   and
 continue to execute mysqld --initialize-insecure --user=mysql; --- this In one step, create some files in the data directory and

 
 execute net start mysql to start the service and  
stop the mysql service: net stop mysql, and then restart the mysql service

5. Enter mysql to modify the root password The
default root password is empty.
Execute mysql -uroot -p and press
Enter to enter the default passwordless
switch to the database mysql
use mysql
to modify the root password

This way of writing is only available in versions before mysql5.6. 5.7 does not have this column.
Check  the field desc user of the user table;

how to set it? ?
Use set password = password('admin'); to set the password. And refresh permissions flush privileges;

re-login to mysql

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326309701&siteId=291194637