How to install Mysql 5.7in windows Green
This article mainly introduces the windows Mysql 5.7 how to install green, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
1.1 download
Http://dev.mysql.com/downloads/mysql/ download address, select the appropriate version in the drop-down box
1.2 installation
Download the green installation package and extract it directly to E:\ mysql
1.3Editing my.ini files
A copy of the mydefault.ini copy, which should be one of the parameters.
Add the following to mysqld
Basedir= "E:\ mysql\"
Datadir= "E:\ mysql\ data"
Port=3306
# skip-grant-tables
E:\ mysql\ bin > mysqld-- initialize
2016-09-06T13:57:01.349392Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is
Deprecated. Please use-explicit_defaults_for_timestamp server option (see doc
Umentation for more details).
2016-09-06T13:57:01.353393Z 0 [ERROR]-- initialize specified but the data direct
Ory has files in it. Aborting.
2016-09-06T13:57:01.354393Z 0 [ERROR] Aborting
The above error occurred because there were files in the data folder before. Delete all the files under data and re-execute the mysqld.exe-initialize command ok
E:\ mysql\ bin > mysqld.exe-- initialize
E:\ mysql\ bin > mysqld.exe-- install
Service successfully installed.
E:\ mysql\ bin > net start mysql
The MySQL service is starting.
The MySQL service has started successfully.
E:\ mysql\ bin > mysql-h localhost-u root-p
Enter password: *
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: y)
ES)
1.4 change password
There's no way to change the password.
Join under mysqld
Skip-grant-tables
E:\ mysql\ bin > net stop mysql
The MySQL service is stopping.
The MySQL service stopped successfully.
E:\ mysql\ bin > net start mysql
The MySQL service is starting.
The MySQL service has started successfully.
E:\ mysql\ bin > mysql-u root-p
Enter password:
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 2
Server version: 5.7.14 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Mysql >
Mysql > update user set password=password ("mysql") where user= "root"
ERROR 1054 (42S22): Unknown column 'password' in' field list'
This error occurs because the password field changes to authentication_string after mysql 5.7
Mysql > update user set authentication_string=password ("mysql") where user= "root"
Query OK, 1 row affected, 1 warning (0.10 sec)
Rows matched: 1 Changed: 1 Warnings: 1
Mysql > flush privileges
Query OK, 0 rows affected (0.00 sec)
Mysql > quit
Bye
Comment out the skip-grant-tables in my.ini and restart the mysql service
E:\ mysql\ bin > mysql-h localhost-u root-p
Enter password: *
Welcome to the MySQL monitor. Commands end with; or\ g.
Your MySQL connection id is 2
Server version: 5.7.14
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.
Mysql > show databases
ERROR 1820 (HY000): You must reset your password using ALTER USER statement befo
Re executing this statement.
Mysql > alter user 'root'@'localhost' identified by' mysql'
Query OK, 0 rows affected (0.00 sec)
Mysql > show databases
+-+
| | Database |
+-+
| | information_schema |
| | mysql |
| | performance_schema |
| | sys |
+-+
4 rows in set (0.00 sec)
Thank you for reading this article carefully. I hope the article "how to install Mysql 5.7 in windows" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!