Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
root@testphp:/# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.5 (stretch)
Release: 9.5
Codename: stretch
root@testphp:/# mysql -u test -ptest -e "SHOW DATABASES;"
| Database |
| information_schema |
| test |
root@testphp:/# cat /var/www/html/mysql.php
echo 'Current PHP version: ' . phpversion();
$link = mysql_connect("localhost", "test", "test")
or die("Could not connect: " . mysql_error());
echo ("Connected successfully\n");
$db_list = mysql_list_dbs($link);
while ($db = mysql_fetch_object($db_list))
echo $db->Database . "<br />\n";
root@testphp:/# curl http://localhost/mysql.php
Current PHP version: 5.6.38-2+0~20181015120829.6+stretch~1.gbp567807Connected successfully
information_schema<br />
test<br />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.