[phpBB] Host is not allowed to connect to this MySQL server

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
Rhythmatic
A regular
A regular
Posts: 31
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Tue Feb 22, 2011 9:32 am

[phpBB] Host is not allowed to connect to this MySQL server

Post by Rhythmatic »

First off, system specs and such.

Ubuntu server 10.10 x86_64
2 GB RAM / Dual Core unmanaged VDS
MySQL, PHP5, Apache2 all installed using Ubuntu's "tasksel" option for a "LAMP server".
phpBB downloaded from phpbb.com TODAY. Version is 3.0.8, as far as I know.


Here's what I'm trying to do and what I'm having issues with.

On the page

Code: Select all

http://domaingoeshere.com/phpBB3/install/index.php?mode=install&sub=database
I'm getting
Could not connect to the database, see error message below.
Host 'v-XX-XX-XX-XXX.virt-machine.internap-chicago.nfoservers.com' is not allowed to connect to this MySQL server

Here's what I've done so far.

I installed LAMP software from Ubuntu's default repos using the command

Code: Select all

sudo tasksel
I then set the FQDN to internal.mydomainwouldgohereifiwerentparanoid.org.
I realized that I hadn't ever been prompted to create a password for my MySQL server, so I googled around and found this page and followed its instructions as a sort of "hacky" solution. It seemed to work fine, as all the right messages showed up. I did that after doing a

Code: Select all

sudo su -
mostly for convenience. After that, I edited my hostname and hosts file as mentioned here and restarted the Apache server, confirming that it no longer cried about not being able to figure out wtf to do with the absent FQDN. Sounds like a success to me. I then uploaded the phpBB installation folder to

Code: Select all

/var/www/phpBB
and connected to it from my browser. I ran through the first step, something effectively akin to "make sure you have this stuff installed and then chmod a few files for us", moved on to the second and hit the above-mentioned error. Sadness.
User avatar
Edge100x
Founder
Founder
Posts: 13117
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Edge100x »

Having phpBB connect to the database via "localhost" instead of by the external IP of your VDS should take care of that error. You should be able to then proceed with the installation, using the MySQL root login that you created.

You may also need to create a database as part of this (their installer should let you know if you do). And, I would recommend that you consider creating a separate MySQL login for just phpBB, for security reasons.
Rhythmatic
A regular
A regular
Posts: 31
Joined: Tue Feb 22, 2011 9:32 am

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Rhythmatic »

Ah, good call. I had tried using 127.0.0.1, as it's generally considered to be the same as "localhost" and it always gave a weird answer, indicating that the daemon wasn't even running on that address.

Now I get the following:
Could not connect to the database, see error message below.
Unknown database 'phpBB'
So I assume that I need to make the db. I assume that I do the usual mysql -u root -p password and then type some jazz to make it create the database? It should be fine after that, right?
Rhythmatic
A regular
A regular
Posts: 31
Joined: Tue Feb 22, 2011 9:32 am

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Rhythmatic »

Oh, and what particular this and that should I do to make that other account and how do I set the security parameters so that it's more secure, as you mentioned?
User avatar
Edge100x
Founder
Founder
Posts: 13117
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Edge100x »

I'm working from memory on this, but try this at the MySQL prompt (mysql -p, as you mentioned):

Code: Select all

create database phpBB;
grant all privileges on phpBB.* to phpbb@localhost identified by 'somepassword';
This should create a "phpBB" database and a "phpbb" user that can access it using the password "somepassword".
Rhythmatic
A regular
A regular
Posts: 31
Joined: Tue Feb 22, 2011 9:32 am

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Rhythmatic »

You're going to love this. Earlier, when I put a password on the root MySQL account, I followed my normal pattern of opening a text editor and typing out a random combination of lowercase, uppercase, numbers, and symbols, at least 8 characters long. One of those was a '('. It keeps saying "syntax error near unexpected token "(".

FML.
Rhythmatic
A regular
A regular
Posts: 31
Joined: Tue Feb 22, 2011 9:32 am

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Rhythmatic »

Erm. Nevermind. I know how to reset the password. Give me a few minutes and then I'll try your suggestion.
Rhythmatic
A regular
A regular
Posts: 31
Joined: Tue Feb 22, 2011 9:32 am

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by Rhythmatic »

SUCCESS!

Awesome. That worked perfectly. Thanks, John.
User avatar
hlds_noob
Compulsive poster
Compulsive poster
Posts: 69
Joined: Sun Feb 20, 2011 10:28 pm
Contact:

Re: [phpBB] Host is not allowed to connect to this MySQL ser

Post by hlds_noob »

I don't mean to go off topic here, but I used to run phpbb forums for many years, Until I found RavenNuke. You may want to check into this fully patched version of phpNuke, because it is REALLY secure, and you get an entire CMS (full site) with the NukeSentinel security module, that stops script kiddies in their tracks with the custom pc_killer_templates.

It comes with an installer script that allows you to install you're site in minutes.
All you need do is add you're db info to the config.php file and you're done.

There are tons of blocks and modules for it as well and whats more, you get an up to date version with an ongoing community for support and patches.

I think I mentioned adding it to the installer, to John a few years ago, Not sure if he got a chance to look at it or not. ;)
Post Reply