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.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
gch5185
Registered User
Posts: 122
Joined: Sun Nov 26, 2006 3:29 am

How to do Remote SQL?

Post by gch5185 »

Hi.

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

<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysql';
$dbhost = 109.3.102.32';
$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 '109.3.102.32' (4) [2003]

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

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

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 0.0.0.0)
3. mysql user table must have an access entry for your user at your host (grant all privileges on jooka_venom.* to jooka_phpbb@1.2.3.4 identified by 'password' - replace 1.2.3.4 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://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
User avatar
Sshadow
Registered User
Posts: 299
Joined: Thu Aug 20, 2009 3:54 pm
Name: Chris C.
Contact:

Re: How to do Remote SQL?

Post by Sshadow »

in

Code: Select all

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

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.

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

Premium phpBB 3.3 Styles by PlanetStyles.net

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

Return to “[3.0.x] Support Forum”