配置my.ini文件mysql
[client] port=3306 default-character-set=utf8 [mysqld] # 設置爲本身MYSQL的安裝目錄 basedir=D:\Program Files\MySQL\MySQL Server 5.7-3306 # 設置爲MYSQL的數據目錄 datadir=D:\Program Files\MySQL\MySQL Server 5.7-3306\data #設置3306端口 port=3306 # 服務端使用的字符集默認爲8比特編碼的latin1字符集 character_set_server=utf8 # 建立新表時將使用的默認存儲引擎 default-storage-engine=INNODB sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES #開啓查詢緩存 explicit_defaults_for_timestamp=true skip-grant-tables
在dos命令下進入mysql的bin目錄 ,執行sql
mysqld --install mysqld_3306 (重命名服務名是爲了方便多實例安裝)緩存
mysqld --initialize this
密碼在後綴名爲err的文件中編碼
2019-09-02T12:43:21.832824Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2019-09-02T12:43:21.832824Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2019-09-02T12:43:23.782828Z 0 [Warning] InnoDB: New log files created, LSN=45790 2019-09-02T12:43:24.344429Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. 2019-09-02T12:43:24.531629Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 40ec5e78-cd7f-11e9-be0a-7c7a911e77d7. 2019-09-02T12:43:24.578429Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. 2019-09-02T12:43:24.609629Z 1 [Note] A temporary password is generated for root@localhost: xgylo1yich+V 2019-09-02T12:43:57.978088Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release. 2019-09-02T12:43:57.978088Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set. 2019-09-02T12:43:57.978088Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled 2019-09-02T12:43:57.978088Z 0 [Note] mysqld_3306 (mysqld 5.7.24) starting as process 4008 ... 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: Uses event mutexes 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: _mm_lfence() and _mm_sfence() are used for memory barrier 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.11 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: Number of pools: 1 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: Not using CPU crc32 instructions 2019-09-02T12:43:57.993688Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M 2019-09-02T