本篇內容介紹了“Windows Server 2008怎么安裝MySQL Community Server 5.7.16”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
我們可以登錄MySQL官網來下載安裝介質,網址是:http://dev.mysql.com/downloads/。我選擇的是64位壓縮包版本“Windows (x86, 64-bit), ZIP Archive”。
將下載到本地的安裝介質解壓縮。然后,將解壓后的文件夾mysql-5.7.16-winx64拷貝到安裝目錄(E盤根目錄)下。
右鍵點擊 計算機>>屬性>> 高級系統屬性>>環境變量>> 編輯 Path ,在最后添加” ;E:\mysql-5.7.16-winx64\bin“,確定。
在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
點擊(此處)折疊或打開
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>
需要注意的是,如果不指定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即為隨機密碼。
我們會看到界面出現: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>
輸入 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>
安全起見,我們修改一下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>
“Windows Server 2008怎么安裝MySQL Community Server 5.7.16”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注億速云網站,小編將為大家輸出更多高質量的實用文章!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。