首先執(zhí)行命令Setup/reset Database for labs時(shí),mysqlsql時(shí)報(bào)錯(cuò):
SETTING UP THE DATABASE SCHEMA AND POPULATING DATA IN TABLES:
Warning: mysql_connect(): Server sent charset (255) unknown to the client. Please, report to the developers in?D:\develop\networkSecurity\phpStudy\PHPTutorial\WWW\sqli-labs\sql-connections\setup-db.php?on line?29
Warning: mysql_connect(): Server sent charset unknown to the client. Please, report to the developers in?D:\develop\networkSecurity\phpStudy\PHPTutorial\WWW\sqli-labs\sql-connections\setup-db.php?on line?29
[*]...................Could not connect to DB, check the creds in db-creds.inc: Server sent charset unknown to the client. Please, report to the developers
由錯(cuò)誤可知是mysql 8的編碼問題。
解決為修改mysql編碼為utf8:
1、打卡mysql 8安裝目錄下的data文件夾,找到my.ini
2、修改兩處my.ini中的配置:
????????character-set-server= utf8
????????default-character-set=utf8
重啟mysql,然后再次執(zhí)行Setup/reset Database for labs,還是報(bào)錯(cuò):
SETTING UP THE DATABASE SCHEMA AND POPULATING DATA IN TABLES:
Warning: mysql_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in?D:\develop\networkSecurity\phpStudy\PHPTutorial\WWW\sqli-labs\sql-connections\setup-db.php?on line?29
Warning: mysql_query(): MySQL server has gone away in?D:\develop\networkSecurity\phpStudy\PHPTutorial\WWW\sqli-labs\sql-connections\setup-db.php?on line?42
Warning: mysql_query(): Error reading result set's header in?D:\develop\networkSecurity\phpStudy\PHPTutorial\WWW\sqli-labs\sql-connections\setup-db.php?on line?42
[*]...................Error purging database: MySQL server has gone away
[*]...................Error creating database: MySQL server has gone away
[*]...................Error creating Table: MySQL server has gone away
[*]...................Error creating Table: MySQL server has gone away
[*]...................Error creating Table: MySQL server has gone away
[*]...................Error creating Table: MySQL server has gone away
[*]...................Error inserting data: MySQL server has gone away
[*]...................Error inserting data: MySQL server has gone away
[*]...................Error purging database: MySQL server has gone away
[*]...................Error creating database: MySQL server has gone away
Unable to connect to the database: challengesMySQL server has gone away
著重看標(biāo)紅的地方,授權(quán)有問題。
解決辦法還是修改my.ini配置文件:
default_authentication_plugin=mysql_native_password
再次重啟mysql8并執(zhí)行Setup/reset Database for labs,可以看到數(shù)據(jù)庫(kù)已經(jīng)創(chuàng)建成功了:文章來源:http://www.zghlxwxcb.cn/news/detail-709263.html
SETTING UP THE DATABASE SCHEMA AND POPULATING DATA IN TABLES:
[*]...................Old database 'SECURITY' purged if exists
[*]...................Creating New database 'SECURITY' successfully
[*]...................Creating New Table 'USERS' successfully
[*]...................Creating New Table 'EMAILS' successfully
[*]...................Creating New Table 'UAGENTS' successfully
[*]...................Creating New Table 'REFERERS' successfully
[*]...................Inserted data correctly into table 'USERS'
[*]...................Inserted data correctly into table 'EMAILS'
[*]...................Old database purged if exists
[*]...................Creating New database successfully
[*]...................Creating New Table 'XJGY3ZCPBW' successfully
[*]...................Inserted data correctly into table 'XJGY3ZCPBW'
[*]...................Inserted secret key 'secret_FT7Y' into table
?文章來源地址http://www.zghlxwxcb.cn/news/detail-709263.html
到了這里,關(guān)于安裝sqli-labs時(shí),mysql 8 報(bào)錯(cuò)解決的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!