MYSQL 5.7.16 unzip installation process

windows server 2012 64bit
mysql-5.7.16-winx64.zip

1. Unzip to d:/mysql/mysql5716, create d:/mysql/mysql5716/tmp, d:/mysql/mysql5716/log and d:/mysql/mysql5716 /data directory, rename d:/mysql/mysql5716/my-default.ini to my.ini, and make appropriate modifications

quote


[mysql]
default-character-set=utf8

[mysqld]

#如果不加双引号,反斜杠必须是两个(转义字符)
basedir=D:/mysql/mysql5716
tmpdir=D:/mysql/mysql5716/tmp
datadir=D:/mysql/mysql5716/data
port=3306
server_id=1

character-set-server=utf8
default-storage-engine=INNODB
innodb_file_per_table=1
lower_case_table_names=1
innodb_buffer_pool_size = 128M
join_buffer_size = 128M
sort_buffer_size = 2M
read_rnd_buffer_size = 2M

# General and Slow logging.
log-output=FILE
slow-query-log=1
slow_query_log_file=D:/mysql/mysql5716/log/slow-query.log
long_query_time=5

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES




2. Configure the environment variables of winodws

3. Use the administrator to run the command line window and enter d:/mysql/mysql5716/bin

4. Under mysql/bin, run:
   mysqld --install
   Relatively, the command to uninstall the service is: mysql --remove MySQL (of course, the service must be stopped first)

5. Under mysql/bin, run:
   mysqld --initialize --console
   If successful, record the default root@localhost password at the end;
   if there is an error message , it may be that the directory configured in my.ini is not found (such as tmpdir, which needs to be manually created in advance)

6. Under mysql/bin, run:
   net start MySQL
   starts successfully.

7. Under mysql/bin, run:
   mysql -uroot -p Press
   Enter to connect to mysql, and enter the default password recorded above

8. Enter under mysql>:
   use msysql; report the following error message, this is because the first time To enter mysql, you need to change the root password
  
quote

ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
  

9. Enter under mysql>:
   update mysql.user set authentication_string=password('12345678') where user='root' and Host = 'localhost';
   change the root password to 12345678. Note: Starting from 5.7, the user table does not have the apssword field, but the authentication_string field.
quote

Query OK, 0 rows affected, 1 warning (0.00 sec)


    I installed 5.7.17 once, but running this doesn't work, or you need to reset the password first, and then execute this sentence first:
    set password for 'root'@'localhost'=password('12345678');

10. In mysql> Enter:
    update mysql.user set host = '%' where user = 'root'; In this way, mysql can use the client tool to connect remotely.
11. Finally, under mysql> enter:
    flush privileges;
12. Under mysql/bin, run:
    net stop MySQL
    to stop mysql, and then run:
    net start MySQL
    to complete the restart.


At the beginning, the 5th step was not executed, and the mysql service could not be started. Later, after checking the information, it was found that after the mysql5.7.7 version, the decompressed version no longer comes with data initialization data, and step 5 needs to be performed to initialize mysql.




Guess you like

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