MySQL 5.7.17 for WIN8安裝初探
1. 下載MySQL Community Server 5.7.17,注意選擇系統型別(32位/64位)
2. 解壓縮MySQL壓縮包到指定目錄:
3.新增環境變數
右鍵-->我的電腦-->屬性--> 高階系統設定-->環境變數
新建系統變數:
變數名:MYSQL_HOME
變數值:D:\database\mysql-5.7.17-winx64
再在path末尾中新增 %MYSQL_HOME%\bin
例如:
D:\Python27;C:\Users\duansf\Desktop\vim\vim80;%MYSQL_HOME%\bin
4.註冊為windows系統服務:
需要在命令提示符(管理員模式)下執行:
d:\database\mysql-5.7.17-winx64\bin>d:\database\mysql-5.7.17-winx64\bin\mysqld install MySQL --defaults-file="d:\database\mysql-5.7.17-winx64\my.ini"
Service successfully installed.
my.ini內容如下:
[mysql]
# 設定mysql客戶端預設字符集
default-character-set=utf8
[mysqld]
#設定3306埠
port = 3306
# 設定mysql的安裝目錄
basedir=D:/database/mysql-5.7.17-winx64
# 設定mysql資料庫的資料的存放目錄
datadir=D:/database/mysql-5.7.17-winx64/data
slow_query_log=TRUE
slow_query_log_file=d:/slow_query_log.txt
long_query_time=1
# 允許最大連線數
max_connections=200
# 服務端使用的字符集預設為8位元編碼的latin1字符集
character-set-server=utf8
# 建立新表時將使用的預設儲存引擎
default-storage-engine=INNODB
# 主從複製引數配置
log_bin = mysql-bin
server_id = 1
5.手動啟動MySQL服務:
d:\database\mysql-5.7.17-winx64\bin>net start mysql
MySQL 服務正在啟動 ..
MySQL 服務無法啟動。
服務沒有報告任何錯誤。
請鍵入 NET HELPMSG 3534 以獲得更多的幫助。
手動啟動服務失敗,經檢視官方資料,解決思路如下:
啟動前我們需要使用-initialize初始化Data目錄生成並生成隨機密碼,使用-initialize-insecure可以生成空密碼。預設帳號root
此處我們用-initialize-insecure生成空密碼
d:\database\mysql-5.7.17-winx64\bin>mysqld --initialize-insecure
d:\database\mysql-5.7.17-winx64\bin>net start mysql
MySQL 服務正在啟動 ..
MySQL 服務已經啟動成功。
用空密碼登入:
C:\Users\duansf>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17-log 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql>
6.更改root密碼:
mysql> UPDATE mysql.user SET password=PASSWORD("123456") WHERE user='root';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql>
更改密碼報錯,因為新版5.7版本的mysql資料庫下的user表中已經沒有Password欄位了,而是將加密後的使用者密碼儲存於authentication_string欄位
更改密碼命令如下:
mysql> update MySQL.user set authentication_string=password('123456') where user='root';
Query OK, 1 row affected, 1 warning (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql>
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.13 sec)
7.用新密碼登入:
d:\database\mysql-5.7.17-winx64\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.17-log 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>
2. 解壓縮MySQL壓縮包到指定目錄:
3.新增環境變數
右鍵-->我的電腦-->屬性--> 高階系統設定-->環境變數
新建系統變數:
變數名:MYSQL_HOME
變數值:D:\database\mysql-5.7.17-winx64
再在path末尾中新增 %MYSQL_HOME%\bin
例如:
D:\Python27;C:\Users\duansf\Desktop\vim\vim80;%MYSQL_HOME%\bin
4.註冊為windows系統服務:
需要在命令提示符(管理員模式)下執行:
d:\database\mysql-5.7.17-winx64\bin>d:\database\mysql-5.7.17-winx64\bin\mysqld install MySQL --defaults-file="d:\database\mysql-5.7.17-winx64\my.ini"
Service successfully installed.
my.ini內容如下:
[mysql]
# 設定mysql客戶端預設字符集
default-character-set=utf8
[mysqld]
#設定3306埠
port = 3306
# 設定mysql的安裝目錄
basedir=D:/database/mysql-5.7.17-winx64
# 設定mysql資料庫的資料的存放目錄
datadir=D:/database/mysql-5.7.17-winx64/data
slow_query_log=TRUE
slow_query_log_file=d:/slow_query_log.txt
long_query_time=1
# 允許最大連線數
max_connections=200
# 服務端使用的字符集預設為8位元編碼的latin1字符集
character-set-server=utf8
# 建立新表時將使用的預設儲存引擎
default-storage-engine=INNODB
# 主從複製引數配置
log_bin = mysql-bin
server_id = 1
5.手動啟動MySQL服務:
d:\database\mysql-5.7.17-winx64\bin>net start mysql
MySQL 服務正在啟動 ..
MySQL 服務無法啟動。
服務沒有報告任何錯誤。
請鍵入 NET HELPMSG 3534 以獲得更多的幫助。
手動啟動服務失敗,經檢視官方資料,解決思路如下:
啟動前我們需要使用-initialize初始化Data目錄生成並生成隨機密碼,使用-initialize-insecure可以生成空密碼。預設帳號root
此處我們用-initialize-insecure生成空密碼
d:\database\mysql-5.7.17-winx64\bin>mysqld --initialize-insecure
d:\database\mysql-5.7.17-winx64\bin>net start mysql
MySQL 服務正在啟動 ..
MySQL 服務已經啟動成功。
用空密碼登入:
C:\Users\duansf>mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.17-log 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> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql>
6.更改root密碼:
mysql> UPDATE mysql.user SET password=PASSWORD("123456") WHERE user='root';
ERROR 1054 (42S22): Unknown column 'password' in 'field list'
mysql>
更改密碼報錯,因為新版5.7版本的mysql資料庫下的user表中已經沒有Password欄位了,而是將加密後的使用者密碼儲存於authentication_string欄位
更改密碼命令如下:
mysql> update MySQL.user set authentication_string=password('123456') where user='root';
Query OK, 1 row affected, 1 warning (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql>
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.13 sec)
7.用新密碼登入:
d:\database\mysql-5.7.17-winx64\bin>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.17-log 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>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15498/viewspace-2134955/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mysql 5.7.17 編譯安裝MySql編譯
- mysql-5.7.17-winx64安裝MySql
- CentOS 6.5下快速安裝MySQL 5.7.17CentOSMySql
- linux mysql 安裝步驟- 原始碼安裝5.7.17 版本LinuxMySql原始碼
- mysql5.7.17 64位rhel6.5下安裝MySql
- MySQL 5.7.17 原始碼方式安裝詳細步驟MySql原始碼
- CentOS7.4使用rpm包安裝mysql5.7.17CentOSMySql
- 【MySQL】Tokudb安裝測試初探MySql
- MySQL Innotop for Linux安裝初探MySqlLinux
- MySQL Inception For Linux安裝初探MySqlLinux
- windows中安裝MySQL綠色社群版(5.7.17-winx64)WindowsMySql
- MySQL 5.7.17 安裝報錯SSL error: Unable to get private key fromMySqlError
- Ubuntu 16.04下 Mysql5.7.17原始碼編譯與安裝UbuntuMySql原始碼編譯
- MySQL5.7.17原始碼編譯安裝時的注意事項MySql原始碼編譯
- MySQL 5.7.17 安裝報錯CMake Error at cmake/boost.cmake:81 (MESSAGE)MySqlError
- 【Mysql】MySQL5.7.17- Group Replication搭建MySql
- MySQL5.6 audit審計外掛安裝初探MySql
- SSDB安裝和使用初探
- win8安裝.net3.5
- 安裝win8時提不能在gpt磁碟中安裝GPT
- Arthas 初探--安裝初步適用
- mysql安裝 (yum 安裝)MySql
- 【MySQL】MySQL 5.7 初探MySql
- MySQL升級從5.1.71到5.7.17版本MySql
- MySQL 5.7.17 Group Relication(組複製)搭建手冊MySql
- 虛擬機器怎麼安裝win8 ?虛擬機
- win8系統怎麼安裝印表機?
- 雙系統如何解除安裝win8
- mysql 安裝MySql
- MySQL安裝MySql
- 安裝mysqlMySql
- solaris mysql 安裝 解除安裝MySql
- [mysql]ubuntu安裝mysqlMySqlUbuntu
- clickhouse for centos7安裝和使用初探CentOS
- Consul初探-從安裝到執行
- 連網安裝mysql與原始碼安裝mysqlMySql原始碼
- MySQL 索引初探MySql索引
- MySQL 8.4 初探MySql