MyBB Community Forums

Full Version: Moved to new hosting account, now MyBB dead
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I had to move my existing working mybb forum from one godaddy host to another godaddy host.
The new one uses cPanel, and I had to put the forum directory under public_html

I copied all the files and restored the database

I changed the config.php file in the inc folder

from
$config['database']['hostname'] = 'xxxxxxxxx.db.11813701.hostedresource.com';
to
$config['database']['hostname'] = 'localhost';

As apparently, this is the setting with cPanel hosting.


When I attempt to access the site:

MyBB has experienced an internal SQL error and cannot continue.
SQL Error:0 - Query:[READ] Unable to select database


Huh
Quote:This occurs when you are using MySQL and the database name or database username is incorrect in ./inc/config.php
To fix this, open ./inc/config.php and check the entries for $config['database']['database'] and $config['database']['username']
If you do not know what needs to be here, contact your host provider
(2014-10-01, 05:30 PM).m. Wrote: [ -> ]
Quote:This occurs when you are using MySQL and the database name or database username is incorrect in ./inc/config.php
To fix this, open ./inc/config.php and check the entries for $config['database']['database'] and $config['database']['username']
If you do not know what needs to be here, contact your host provider

When I created the database on the new hosting, I used the same database name and user name, they are the same.  I used the same password too.   I just copied and pasted.   When I was done, I restored the database.  There were no errors or issues reported.   So the only change that was needed in config.php was the hostname

The error is not very descriptive so I'm not sure what is going on.
Try creating a new user for the database and assign it privileges. Afterwards, update your inc/config.php file with the new user credentials.
(2014-10-01, 06:25 PM)dragonexpert Wrote: [ -> ]Try creating a new user for the database and assign it privileges.  Afterwards, update your inc/config.php file with the new user credentials.


I just did that.  Created a new user for the database.   Changed the config.php file, but there was no change.
There were no setting for privileges associated with the database.

As a test, I changed the name of the host in the config.php to namexxx, and the error was the same
I tried the IP address as the hostname, same result.

Godaddy has horrid info on this, all they say is that the database host is the same as the localhost


$config['database']['hostname'] = 'localhost';

Any other suggestions?
(2014-10-01, 06:23 PM)split Wrote: [ -> ]So the only change that was needed in config.php was the hostname

Did you use a new password that was generated? If so you'll need to update that aswell.
When you create a database and add a user for that database on godaddy, there is one additional step. The user must be added to the database as a separate action and in this step the permissions are applied. It seemed implied that when the database and user were created as one action, that clearly that user was for that database, but no. Once I added the user and privileges, the forum came alive.
In CPanel if your host has that, you can use a Wizard for doing it. If you know GRANT syntax in SQL, you can also use that.