tomsik68 / docker-xampp

Dockerfile to build an image containing XAMPP(MySQL + PHP + PHPMyAdmin) running on Debian system with SSH server
https://hub.docker.com/r/tomsik68/xampp/
MIT License
198 stars 109 forks source link

[Question] Setting up DVWA on docker-xampp #46

Closed yozachar closed 2 years ago

yozachar commented 2 years ago

Hello,

I'm running Docker on Linux. I use the following command to start the container:

docker run --name DockerXAMPP -p 41061:22 -p 41062:80 -d tomsik68/xampp

I copied DVWA files to DockerXAMPP:/opt/lampp/htdocs/DVWA/. After navigating to http://localhost:41062/DVWA/setup.php, when I click on Create / Reset Database, it errors into:

Fatal error: Uncaught mysqli_sql_exception: Access denied for user 'dvwa'@'localhost' (using password: YES) in 
/opt/lampp/htdocs/DVWA/dvwa/includes/DBMS/MySQL.php:13
Stack trace: 
#0 /opt/lampp/htdocs/DVWA/dvwa/includes/DBMS/MySQL.php(13): mysqli_connect('127.0.0.1', 'dvwa', 'p@ssw0rd', '', '3306')
#1 /opt/lampp/htdocs/DVWA/setup.php(23): include_once('/opt/lampp/htdo...')
#2 {main} thrown in /opt/lampp/htdocs/DVWA/dvwa/includes/DBMS/MySQL.php on line 13

Are the database defaults different? Where am I going wrong?

All help is appreciated! Thank you!

yozachar commented 2 years ago

Had to update config.inc.php with these values:

$_DVWA[ 'db_user' ]     = 'root';
$_DVWA[ 'db_password' ] = '';