配置程序中我主要遇到兩個問題,且在網上沒有尋找到好的解決方案,在這里記錄一下,希望可以幫助到同樣遇到此問題的朋友,
第一個問題是:Could not connect to the database service. Please check the config file. Database Error #2003: Can’t connect to MySQL server on ‘127.0.0.1’ (13).
如果你使用的也是mariadb,你需要在資料庫進行如下命令,新建一個名為dvwa的資料庫和同名的用戶,代碼如下:
首先用root用戶進入資料庫,方法百度有,或者我后續添加進來,成功進入后進行如下操作:
mysql> create database dvwa;
Query OK, 1 row affected (0.00 sec)
mysql> create user dvwa@localhost identified by ‘p@ssw0rd’;
Query OK, 0 rows affected (0.01 sec)
mysql> grant all on dvwa.* to dvwa@localhost;
Query OK, 0 rows affected (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
我修改好以后,繼續嘗試DVWA的創建操作,發現依舊是這個報錯,我查閱了網上資料沒有解決反而遇到新的錯誤,這個一會再寫,最終我發現是selinux沒有關閉,將selinux關閉后便沒有了報錯,問題得以解決,
這個問題百度上很多解決方案是修改config檔案,將user改為root 密碼為root或空,但如果你使用的mariadb的話,是不可以使用root用戶的,圖為README中解釋
改為root用戶,會出現新的錯誤:Your database user is root, if you are using MariaDB, this will not work, please read the README.md file.
原創,轉載請標明,
后續還有問題我會繼續補充,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/317811.html
標籤:其他
上一篇:代碼審計之從入門到入墳
