Report this

What is the reason for this report?

Can't connect to mysql server

Posted on September 16, 2020

Hi,

I’m a newbie to databases. What I’ve done is:

  • setup PhpMyAdmin Droplet
  • logged onto PhpMyAdmin using ‘admin’ user and a certain password ‘password’, and I created a database called ‘test’
  • connected using WinSCP & uploaded php file
  • run the php file as follows:

<?php $con = mysqli_connect(‘localhost’, ‘admin’, ‘password’, ‘test’) or die("Connection failed: " . mysqli_connect_errno()); ?>

Somehow, now matter what I try, it keeps giving me a connection error. Am I doing something wrong?

The developer cloud

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

Start building today

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