How to do Remote SQL?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Anti-Spam Guide
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Registered User
Posts: 122
Joined: Sun Nov 26, 2006 3:29 am

How to do Remote SQL?

Post by gch5185 »


I have added the host ip address from the other hosting of mine, allowing my external web server to access my MySQL databases. Next, I have edited the config.php file as following.

Code: Select all

// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysql';
$dbhost =';
$dbport = '3306';
$dbname = 'jooka_venom';
$dbuser = 'jooka_phpbb';
$dbpasswd = '123456';
$table_prefix = 'phpbb_';
$acm_type = 'file';
$load_extensions = '';

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
I tried to open my web page that connects to my external web server. I received this error message.

Code: Select all

SQL ERROR [ mysql4 ]

Can't connect to MySQL server on '' (4) [2003]

An sql error occurred while fetching this page. Please contact an administrator if this problem persists.

For your information, is my host ip address. Do you think I configured this correctly else please correct me. Thank you in advance.
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC

Re: How to do Remote SQL?

Post by Oleg »

In order to connect to mysql remotely all of the following needs to be true:

1. mysql must be listening on network (skip_networking not set in my.cnf)
2. mysql must be listening on the internet ip (bind_address either not set or set to public ip address of the db server or
3. mysql user table must have an access entry for your user at your host (grant all privileges on jooka_venom.* to jooka_phpbb@ identified by 'password' - replace with ip you use to connect, or % (less secure); see grant for more details)
4. os firewall must allow access to port 3306 from internet

If you have shell access to your web server try connecting with mysql console client: mysql -h host -u user -p database

You should probably not talk to your database without using ssl, but how to set this up is an exercise for the reader.
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://]Development IRC chat[/url]
My stuff:
User avatar
Registered User
Posts: 299
Joined: Thu Aug 20, 2009 3:54 pm
Name: Chris C.

Re: How to do Remote SQL?

Post by Sshadow »


Code: Select all

$dbhost =';
you are missing an opening ' to the ip?
User avatar
Lumpy Burgertushie
Registered User
Posts: 67999
Joined: Mon May 02, 2005 3:11 am

Re: How to do Remote SQL?

Post by Lumpy Burgertushie »

also, I doubt that the IP you are using is actually the database server IP, you said it is your
"host IP address".

also, I doubt that your host is going to let you connect to their database server remotely. Most do not allow that.

check with the host to see if they allow it, and how to do it if they do.

I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by

If nobody is in the forest, does a tree really fall?

Return to “[3.0.x] Support Forum”