MySQL是一款廣泛應用的關系型數據庫管理系統,其版本眾多。其中,MySQL 5.7是目前使用最廣泛的版本之一。
對于想要使用MySQL 5.7的用戶,可以通過官網進行下載。在下載方式上,有兩種選擇:二進制安裝包和ZIP壓縮文件。本文將介紹如何通過 ZIP 下載MySQL 5.7。
首先,在官網的MySQL 5.7下載頁面(https://dev.mysql.com/downloads/mysql/5.7.html)中,找到ZIP Archives選項,然后進入該頁面。
在ZIP Archives頁面中,會看到多個版本的MySQL 5.7 ZIP壓縮文件。選擇根據自己需要進行下載。針對Windows系統,我們選擇Windows(x86, 64-bit), ZIP Archive。
下載完成后,解壓縮文件,得到以下文件:
mysql-5.7.34-winx64 |__bin |__data |__docs |__include |__lib |__share
其中bin目錄下存放的是MySQL的可執行文件,data目錄下存放的是數據庫的數據文件,docs目錄存放的是MySQL的文檔。include目錄下存放的是MySQL的頭文件,lib目錄下存放的是MySQL的庫文件,share目錄下存放的是MySQL的共享文件。
要啟動MySQL服務,需要在命令行中進入bin目錄,執行命令:mysqld.exe --console。
C:\>cd mysql-5.7.34-winx64\bin C:\mysql-5.7.34-winx64\bin>mysqld.exe --console
執行成功后,在命令行中會看到類似以下的輸出:
[Note] Plugin 'FEDERATED' is disabled. [Note] InnoDB: Using atomics to ref count buffer pool pages [Note] InnoDB: Memory barrier is not used [Note] InnoDB: Compressed tables use zlib 1.2.11 [Note] InnoDB: Number of pools: 1 [Note] InnoDB: Using CPU crc32 instructions [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M [Note] InnoDB: Completed initialization of buffer pool [Note] InnoDB: Starting crash recovery from checkpoint LSN=24519726 [Note] InnoDB: 128 out of 128 rollback segments are active. [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" [Note] InnoDB: Creating shared tablespace with name ".\ibdata1" [Note] InnoDB: Setting file '.\ibdata1' size to 12 MB. Physically writing the file full; Please wait ... [Note] InnoDB: File '.\ibdata1' size is now 12 MB. [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. [Note] InnoDB: 32 non-redo rollback segment(s) are active. [Note] InnoDB: Waiting for purge to start [Note] InnoDB: 5.7.34 started; log sequence number 24531337 [Note] Server hostname (bind-address): '*'; port: 3306 [Note] IPv6 is available. [Note] - '::' resolves to '::'; [Note] Server socket created on IP: '::'. [Note] InnoDB: Buffer pool(s) load completed at 211007 10:37:39 [Note] Ready for connections.
至此,通過ZIP下載MySQL 5.7并啟動MySQL服務的過程已完成。