How to Access MySQLi Database Remotely?

Hello guys,

Please who has any idea how i can access MySQLi database remotely.

i tried the following but still didnt work.

  • i changed root host in PHPMyAdmin from ‘localhost’ to ‘%’
  • i opened port 3306 in cyberpanel firewall

Still am not able to connect.

i have a desktop app and would like to connect to same database.

Am using aaPanel and this works great but want to implement same method in CP.

Any help will be great.


1 Like

you want for whole server or for one site?

for now i need it for just one site but if there’s a way for whole server that will also be great deal to me

That’s a good question. I have the same issue. Has anyone know how you fix that?

Does anyone know a fix?

This is important for me cause a customer needs that option

HELLOW? Knows anyone this issue?


Go to the cyberpanel admin page.
Databases → List Databases
Choose the domain.
In from of the database you want to access remotely, click the “Manage” button.

At “Allow Remote Access on following IP” write “%” and then click save changes, as in the image bellow.

After that, you can use a software like MySQL Workbench or a paid one like Navicat to manage your databases.

Pls read first the thread i cant connect anyways

What error does it give you when connecting?
Is it a connection time out? If so, have you made sure your firewall port is open?
Are you connecting directly by IP or using the domain name? The domain name runs by cloudflare or anything similar in that case?
Have you also tried to whitelist your IP at the firewall?
Are you using CSF aswell? If so, have you tried whitelisting your ip there also?

If everything above failed, disable firewall and attempt to connect, then reply here if with firewall disabled it works or not (then re-enable firewall after testing)



Looks like the port was filtered when you replied.

But i tried again before sending this message and now it shows as “open”.
Was that the issue?

iptables -A INPUT -i eth0 -s -p tcp --destination-port 3306 -j ACCEPT
iptables -A INPUT -i eth0 -s IP -p tcp --destination-port 3306 -j ACCEPT

firewall-cmd --zone=public --add-port=3306/tcp --permanent

Restart vps and done Thank you <3

I have done that, not working.

this is the message i get " Warning : mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it."

Look from logs why your server block connection. Try also disable CSF and modsecurity to see if those blocking.

i don’t have CSF insstalled

How did you solve it please. Can you show me?

check if you have


Comment it


Restart mysql:

systemctl restart mysql
1 Like

Thank very much. working now