国产gaysexchina男同gay,japanrcep老熟妇乱子伦视频,吃奶呻吟打开双腿做受动态图,成人色网站,国产av一区二区三区最新精品

(三)安全性

2018-02-24 16:05 更新

本文是基于MySQL-5.7.7-rc版本,未來(lái)可能 還會(huì)發(fā)生更多變化。本節(jié)開(kāi)始講5.7版本中的新特性。

安全性

a. 用戶表 mysql.user 的 plugin字段不允許為空, 默認(rèn)值是 mysql_native_password,而不是 mysql_old_password,不再支持舊密碼格式;
b. 增加密碼過(guò)期機(jī)制,過(guò)期后需要修改密碼,否則可能會(huì)被禁用,或者進(jìn)入沙箱模式;
c. 使用 mysql_install_db 初始化時(shí),默認(rèn)會(huì)自動(dòng)生成隨機(jī)密碼,并且不創(chuàng)建除 root@localhost 外的其他賬號(hào),也不創(chuàng)建 test 庫(kù);

新特性實(shí)踐

執(zhí)行 mysql_install_db 進(jìn)行新實(shí)例初始化:

[yejr@imysql.com]# ./bin/mysql_install_db --user=mysql --datadir=/data/mysql/

2015-06-24 13:55:29 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2015-06-24 13:55:38 [ERROR]?? Child process: /opt/17173_install/mysql-5.7.7-rc-linux-glibc2.5-x86_64/bin/mysqld terminated prematurely with errno= 32
2015-06-24 13:55:38 [ERROR]?? Failed to execute /opt/17173_install/mysql-5.7.7-rc-linux-glibc2.5-x86_64/bin/mysqld --bootstrap --datadir=/data/mysql --lc-messages-dir=/usr/share/mysql --lc-messages=en_US
-- server log begin --
mysqld: [Warning] --bootstrap is deprecated. Please consider using --initialize instead
-- server log end --

可以看到提示?mysql_install_db?已經(jīng)不再推薦使用了,建議改成mysqld –initialize?完成實(shí)例初始化。

改成?mysqld –initialize?后,如果 datadir 指向的目標(biāo)目錄下已經(jīng)有數(shù)據(jù)文件,則會(huì)有類(lèi)似提示:

[yejr@imysql.com]#./bin/mysqld --user=mysql --basedir=/opt/17173_install/mysql-5.7.7-rc-linux-glibc2.5-x86_64/ --datadir=/data/mysql --initial --initialize-insecure

2015-06-24T06:05:05.533588Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2015-06-24T06:05:05.533627Z 0 [ERROR] Aborting

因此,需要先確保 datadir 目標(biāo)目錄下是空的,避免誤操作破壞已有數(shù)據(jù)。

另外,在初始化時(shí)如果加上?–initial-insecure,則會(huì)創(chuàng)建空密碼的 root@localhost 賬號(hào),否則會(huì)創(chuàng)建帶密碼的 root@localhost 賬號(hào),密碼直接寫(xiě)在 log-error 日志文件中(在5.6版本中是放在 ~/.mysql_secret 文件里,更加隱蔽,不熟悉的話可能會(huì)無(wú)所適從)

[yejr@imysql.com]#./bin/mysqld --user=mysql --basedir=/opt/17173_install/mysql-5.7.7-rc-linux-glibc2.5-x86_64/ --datadir=/data/mysql --initial

2015-06-24T06:14:31.458905Z 0 [Warning] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.

初始化完畢后,如果沒(méi)使用新版本的客戶端登入,還會(huì)報(bào)告類(lèi)似下面的錯(cuò)誤:

mysql -uroot -p
Enter password:
ERROR 1862 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.

上面的錯(cuò)誤提示意思是需要用當(dāng)前版本的客戶端登入,因?yàn)樾掠脩舻侨牒笮枰⒖绦薷拿艽a,否則無(wú)法繼續(xù)后續(xù)的工作:

[(root@imysql.com)]>use mysql
ERROR 1820 (HY000): You must SET PASSWORD before executing this statement

[(root@imysql.com)]>set password = password('abcd');
Query OK, 0 rows affected, 1 warning (0.00 sec)

修改完密碼后,就可以繼續(xù)使用舊版本的客戶端工具了。

下一期,我們繼續(xù)講講5.7的其他新特性。

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)