[Mysql] 1.Mysql 5.7 綠色安裝(windows)
1.1 下載
http://dev.mysql.com/downloads/mysql/ 下載地址 , 在下拉框中選擇相應的版本
1.2 安裝
下載下來的綠色安裝包,直接解壓為 E:\mysql
1.3 編輯 my.ini 檔案,
將 mydefault.ini copy 一份出來,就該其中的引數 .
在 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
出現瞭如上錯誤,是由於之前在 data 資料夾中有檔案導致的,刪掉 data 下所有的檔案,重新執行 mysqld.exe –initialize 命令 ok
E:\mysql\bin>mysqld.exe --initialize
E:\mysql\bin>mysqld.exe --install
Service successfully installed.
E:\mysql\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。
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 修改密碼
沒辦法修改密碼吧
在 mysqld 下加入
skip-grant-tables
E:\mysql\bin>net stop mysql
MySQL 服務正在停止 .
MySQL 服務已成功停止。
E:\mysql\bin>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。
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'
出現這個錯誤是由於 mysql 5.7 後 password 欄位變成 authentication_string
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
將 my.ini 中的 skip-grant-tables 註釋掉,重啟 mysql 服務
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)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2124617/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL5.7綠色版安裝MySql
- mysql 綠色版 安裝MySql
- MySql綠色版安裝配置MySql
- Windows 下JDK綠色免安裝WindowsJDK
- windows中安裝MySQL綠色社群版(5.7.17-winx64)WindowsMySql
- MySql 5.6.36 64位綠色版安裝MySql
- Windows安裝MySQL5.7教程WindowsMySql
- 批處理安裝綠色版MySQL 5.7.24MySql
- windows安裝及配置mysql5.7WindowsMySql
- windows同時安裝 5.7 8.0 mysqlWindowsMySql
- Mysql 5.7 免安裝版windows安裝完整教程MySqlWindows
- MySQL綠色解壓縮版安裝與配置MySql
- 分享 jdk ant 綠色安裝及自動化配置 for windowsJDKWindows
- MySQL5.7 windows二進位制安裝MySqlWindows
- RedHat 9.0 的“綠色”安裝(轉)Redhat
- Docker 安裝 Mysql 5.7DockerMySql
- Windows系統安裝MySQL5.7簡易教程WindowsMySql
- Windows平臺下安裝與配置MySQL5.7WindowsMySql
- mysql5.7 for windows二進位制安裝及配置MySqlWindows
- Mysql5.7 windows免安裝版本 初始化配置MySqlWindows
- CentOS 7 - 安裝MySQL 5.7CentOSMySql
- CentOS 7 安裝 MySQL 5.7CentOSMySql
- mysql5.7 安裝教程MySql
- mysql 5.7 多例項安裝MySql
- centos安裝mysql5.7CentOSMySql
- 元氣桌面桌布免安裝綠色版
- 免安裝(綠色)版maven整合myeclipseMavenEclipse
- windows 7 vs 2013編譯與安裝MySQL 5.7Windows編譯MySql
- Linux下安裝MySQL 5.7LinuxMySql
- Linux 7 安裝Mysql 5.7LinuxMySql
- CentOS 6.5/6.6 安裝mysql 5.7CentOSMySql
- MySQL 5.7安裝部署總結MySql
- 用OneinStack安裝mysql 5.7MySql
- mysql 5.7單例項安裝MySql單例
- MySQL:mysql5.7解壓版安裝與解除安裝MySql
- debian-mysql5.7安裝與解除安裝MySql
- MySQL系列-- 1.MySQL架構MySql架構
- CentOS7.3 安裝 MySQL5.7CentOSMySql