Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi! I’m bamboozled.
Here’s the setup:
I need to connect to the database from a PHP application running on the application server. Everything’s set up. Notably, both PHP and MySQL are installed from the stock packages available in Ubuntu current LTS, which means they are PHP 7.2, and MySQL 5.7.
For the sake of example, let’s say that the IP address of the application server is 20.20.20.20, and the database server is 20.20.40.40. They’re connecting over a DO private network.
Here’s what happens:
mysql -u argonflowers -p -h 20.20.40.40But:
php -f db-test.phpPHP Warning: mysqli_connect(): (HY000/1045): Access denied for user 'argonflowers'@'20.20.20.20' (using password: YES) in /home/argonflowers/db-test.php on line 102019-10-14T02:17:42.923737Z 27 Connect argonflowers@20.20.20.20 on using SSL/TLS
2019-10-14T02:17:42.924714Z 27 Query select @@version_comment limit 1
2019-10-14T02:17:44.503559Z 27 Quit
2019-10-14T02:17:51.359508Z 28 Connect argonflowers@20.20.20.20 on using TCP/IP
2019-10-14T02:17:51.359681Z 28 Connect Access denied for user 'argonflowers'@'20.20.20.20' (using password: YES)
What? This doesn’t make any sense to me. This seems like a “you are sending me the wrong password” error, but the PHP script contains the same password as I enter when prompted by mysql-client. Yes, SSL is enabled, but it’s not being enforced for all incoming connections. I’ve dug around a lot to find out if there are any known gotcha’s in how password hashing happens between PHP 7.2 and MySQL 5.7, but there seemingly aren’t. Also, these are the packages that are default to this distro, so I’m extra surprised it’s this much of a struggle. Please tell me I’m a fool and I’ve missed something obvious!
Here’s the PHP script:
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'inventory';
$dbuser = 'argonflowers';
$dbpass = 'otkgjazmcutrls';
$dbhost = "20.20.40.40";
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
mysqli_select_db($link, $dbname) or die("Could not open the db '$dbname'");
$test_query = "SHOW TABLES FROM $dbname";
$result = mysqli_query($link, $test_query);
$tblCnt = 0;
while($tbl = mysqli_fetch_array($result)) {
$tblCnt++;
#echo $tbl[0]."<br />\n";
}
if (!$tblCnt) {
echo "There are no tables<br />\n";
} else {
echo "There are $tblCnt tables<br />\n";
}
?>
WildcatMedia
jeffs
0621335d663b4b699a60eb27e28153
accesstrax
Dwight Trumbower
admin
yimprogramming
samunyi90
1d6ce141ab5444dfb1ea2dd29cf4b1
Matt Fricker
joel9b158e40551b15093f213f