今天 Oracle 發布了 MySQL 5.7.6 milestone 16,至此,MySQL 5.7 已經開發兩年了。相比 MySQL 5.6,有特別多的改進。團隊主要關注速度,性能據報告是比之前版本提升了 2 至 3 倍!
新特性列表,主要改進:
MySQL 5.6 中,mysql_install_db 在資料庫創建的時候提供選項來生成 random password。
MySQL 5.7.4 中,可以跳過 -skip-random-password 選項來默認生成隨機密碼。
MySQL 5.7.5 中,還是默認生成隨機密碼,但是選項修改為 –insecure
而現在,MySQL 5.7.6 廢棄了 mysql_install_db,使用 mysqld –initialize (formerly known as 「mysqld –bootstrap,」 now deprecated.) 替代。
測試運行:
$ ~/opt/mysql/5.7.6/bin/mysqld --no-defaults --basedir=~/opt/mysql/5.7.6/ --datadir=$PWD/data --initialize2015-03-09T05:06:37.159659Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2015-03-09T05:06:37.355155Z 0 [Warning] InnoDB: New log files created, LSN=457902015-03-09T05:06:37.410118Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.2015-03-09T05:06:37.467002Z 0 [Warning] Failed to setup SSL2015-03-09T05:06:37.467029Z 0 [Warning] SSL error: SSL context is not usable without certificate and private key2015-03-09T05:06:37.468142Z 1 [Warning] A temporary password is generated for root@localhost: f<jqhdJ(A5p#
跟之前版本相比,最主要是沒有生成 .mysql_secret 文件。
但是還有更重要的不同點,那就是這個命令只運行一次!使用 mysql_install_db 時,即使數據目錄存在也可以多次運行。
$ ~/opt/mysql/5.7.6/bin/mysqld --no-defaults --basedir=~/opt/mysql/5.7.6/ --datadir=$PWD/data --initialize2015-03-09T05:49:12.504413Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).2015-03-09T05:49:12.505398Z 0 [ERROR] --initialize specified but the data directory exists. Aborting.2015-03-09T05:49:12.505422Z 0 [ERROR] Aborting
更多新特性分析請看這裡:http://datacharmer.blogspot.jp/2015/03/mysql-5.html。