Windows Server 2008完美安裝MySQL Community Server 5.7.16六步曲
今天在Windows Server 2008 r2系統下部署了MySQL Community Server 5.7.16,安裝過程中也遇到了一些問題,在這兒記錄一下最終的安裝過程。
需要注意的是,如果不指定insecure選項,則會隨機生成登陸密碼, 在E:\mysql-5.7.16-winx64\data資料夾下,有一個 hoegh.err 檔案,其中hoegh是主機名,開啟會看到:
2016-10-20T09:34:56.806257Z 1 [Note] A temporary password is generated for root@localhost: p-mcI:ijR6Xg,
其中 p-mcI:ijR6Xg即為隨機密碼。
~~~~~~~ the end~~~~~~~~~
hoegh
2016.10.20
0.下載安裝介質
我們可以登入MySQL官網來下載安裝介質,網址是:http://dev.mysql.com/downloads/。我選擇的是64位壓縮包版本“Windows (x86, 64-bit), ZIP Archive”。1.解壓縮
將下載到本地的安裝介質解壓縮。然後,將解壓後的資料夾mysql-5.7.16-winx64複製到安裝目錄(E盤根目錄)下。2.設定系統環境變數
右鍵點選 計算機>>屬性>> 高階系統屬性>>環境變數>> 編輯 Path ,在最後新增” ;E:\mysql-5.7.16-winx64\bin“,確定。3.建立my.ini 檔案和data目錄,配置安裝路徑與資料儲存路徑
在E:\mysql-5.7.16-winx64目錄下建立data目錄和my.ini,並在my.ini中配置安裝路徑與資料儲存路徑等資訊。點選(此處)摺疊或開啟
-
[mysql]
-
default-character-set=utf8
-
[mysqld]
-
max_connections=200
-
default-storage-engine=INNODB
-
basedir =E:\mysql-5.7.16-winx64\bin
- datadir =E:\mysql-5.7.16-winx64\data
- port = 3306
4.安裝MySQL服務
首先,以管理員身份執行 cmd 並切換到MySQL的bin目錄下;
接下來,執行mysqld --initialize-insecure
這條命令用來初始化data文件,其中insecure選項指定登入無需口令。
點選(此處)摺疊或開啟
- D:\>e:
- E:\>cd mysql-5.7.16-winx64
- E:\mysql-5.7.16-winx64>cd bin
- E:\mysql-5.7.16-winx64\bin>mysqld --initialize-insecure
- E:\mysql-5.7.16-winx64\bin>
2016-10-20T09:34:56.806257Z 1 [Note] A temporary password is generated for root@localhost: p-mcI:ijR6Xg,
其中 p-mcI:ijR6Xg即為隨機密碼。
然後,輸入 mysqld --install安裝MySQL服務
我們會看到介面出現:Server successfully installed,這就說明MySQL服務安裝成功。點選(此處)摺疊或開啟
- E:\mysql-5.7.16-winx64\bin>
- E:\mysql-5.7.16-winx64\bin>mysqld --install
- Service successfully installed.
- E:\mysql-5.7.16-winx64\bin>
5.啟動MySQL服務
輸入 net start mysql 回車, 就會看到: MySQL 服務已經啟動成功。嘗試使用root使用者登入資料庫,並透過show databases命令檢視資料庫概要資訊。點選(此處)摺疊或開啟
-
E:\mysql-5.7.16-winx64\bin>
-
E:\mysql-5.7.16-winx64\bin>net start mysql
-
MySQL 服務正在啟動 .
- MySQL 服務已經啟動成功。
-
-
-
E:\mysql-5.7.16-winx64\bin>mysql -u root
-
Welcome to the MySQL monitor. Commands end with ; or \g.
-
Your MySQL connection id is 2
-
Server version: 5.7.16 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> show databases;
-
+--------------------+
-
| Database |
-
+--------------------+
-
| information_schema |
-
| mysql |
-
| performance_schema |
-
| sys |
-
+--------------------+
-
4 rows in set (0.00 sec)
-
- mysql>
6.修改root密碼
安全起見,我們修改一下root密碼。點選(此處)摺疊或開啟
-
mysql>
- mysql> alter user 'root'@'localhost' identified by 'root';
-
Query OK, 0 rows affected (0.00 sec)
-
-
mysql>
-
mysql> exit
-
Bye
-
-
E:\mysql-5.7.16-winx64\bin>mysql -u root -proot
-
mysql: [Warning] Using a password on the command line interface can be insecure.
-
Welcome to the MySQL monitor. Commands end with ; or \g.
-
Your MySQL connection id is 4
-
Server version: 5.7.16 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> show databases;
-
+--------------------+
-
| Database |
-
+--------------------+
-
| information_schema |
-
| mysql |
- | performance_schema |
-
| sys |
-
+--------------------+
-
4 rows in set (0.00 sec)
-
- mysql>
~~~~~~~ the end~~~~~~~~~
hoegh
2016.10.20
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30162081/viewspace-2126797/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Community ServerUnityServer
- windows server2008安裝mysql資料庫WindowsServerMySql資料庫
- Windows server 2008 IIS安裝WindowsServer
- MySQL5.7 Unable to find a match: MySQL-community-serverMySqlUnityServer
- mysql installer community 5.7.16安裝詳細教程-MySQLwindow10安裝教程MySqlUnity
- 安裝ECC EHP6 on Windows Server 2008WindowsServer
- Installing SQL Server 2008 on a Windows Server 2008 ClusterSQLServerWindows
- Windows Server 2008環境GTONE安裝及配置WindowsServer
- windows server 2008禁止pingWindowsServer
- 安裝sql server 2008SQLServer
- windows server 2008_安全策略WindowsServer
- openstack 之 windows server 2008映象製作WindowsServer
- windows server 2008 遠端桌面埠修改WindowsServer
- MySQL8.0.11 Community Server 與 驅動 mysql-connector-java-8.0.11.jarMySqlUnityServerJavaJAR
- Windows Server 2008 R2 下載地址WindowsServer
- Windows Server 2008 :IIS 7整合請求管道WindowsServer
- 精通Windows Server 2008 R2 試讀WindowsServer
- IBM X SERVER 安裝 WINDOWSIBMServerWindows
- [轉]WINDOWS伺服器安全加固實戰(WINDOWS SERVER 2008 R2和WINDOWS SERVER 2012)Windows伺服器Server
- Windows Internet Explorer 8 for Windows Vista 和 Windows Server 2008WindowsServer
- 將 Server Community Edition 應用程式方便地遷移到 WebSphere Application ServerServerUnityWebAPP
- Windows Server 2008上補充安裝.NET3.5SP1的方法WindowsServer
- windows server 2008 wamp安裝報000F15A0解決方法WindowsServer
- CentOS7安裝MySQL ServerCentOSMySqlServer
- mysql cluster 一臺server安裝MySqlServer
- Windows Server 2008 RC候選版要釋出了WindowsServer
- Windows Server 2008的一些安全設定WindowsServer
- Windows Server 2008 :IIS 7新體系結構WindowsServer
- Windows Server 2022 安裝WindowsServer
- Windows Server DFSWindowsServer
- 完全解除安裝sql server2008 《轉》SQLServer
- centOS 7 離線安裝 MySQL 5.6 完美安裝CentOSMySql
- MySQL5.7.16原始碼編譯安裝MySql原始碼編譯
- Windows server2008修改遠端桌面埠的方法WindowsServer
- Windows Server 2008 R2搭建WDS服務(PXE)WindowsServer
- Oracle_10.2.0.5_for_Windows_Server_2008 CPU核數限制OracleWindowsServer
- mongodb 3.2.10 for windows server 2008 R2 installationMongoDBWindowsServer
- windows server 2008r2 訪問NFS儲存WindowsServerNFS