MyBB Community Forums

Full Version: Error when migrating SQL database from shared hosting to dedicated server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello everyone,

I'm trying to migrate my forum (http://discussion.cambridge-mt.com) over from 1and1 shared hosting to a 1and1 dedicated server, but they don't automatically carry over pre-existing SQL databases. I've used SSH to copy the SQL database over to the new server, but when I update MyBB's /inc/config.php file to point to the new database I'm getting this error message:

Quote:MyBB has experienced an internal SQL error and cannot continue

SQL Error:
0 -
Query:
[READ] Unable to connect to MySQL server

Here's what the original config.php file code was:

$config['database']['type'] = 'mysqli';
$config['database']['database'] = 'db410051037';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'db410051037.db.1and1.com';
$config['database']['username'] = 'dbo410051037';

And this is what I changed it to based on the information provided about the database by my 1and1 user control panel:

$config['database']['type'] = 'mysqli';
$config['database']['database'] = 'db458455504';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'localhost:/tmp/mysql5.sock';
$config['database']['username'] = 'dbo458455504';

I've done the best I can to search round the error-message FAQs, the Wiki, and this forum to try to sort this problem out for myself, and my hosting service has drawn a blank on it too. Anyone have any ideas?

Some further details of what I've tried already:
- In preparation for the migration, I tried the SSH export/re-import to another shared-hosting SQL database as a test, and that worked fine, so I'm assuming that I've done that correctly.
- I've checked my new local SQL database using phpMyAdmin, and it appears to be populated with all the necessary database fields. In other words, it looks like the SSH re-import was successful, and the database exists.
- I've tried deactivating the two plug-ins I'm using (PHP and Template Conditionals v1.9 by ZiNgA BuRgA and Registration Security Question v1.2 by G33K), and that doesn't seem to help.
- When I contacted 1and1 with details of what I was doing, including a copy of the new config.php file they said: "Is the software returning any specific errors as to why it cannot connect to the database? The database login information appears to be correct in the beginning of the configuration file, but I am unfamiliar with the Memcache section."
- I'm running MyBB v1.6.6, PHP v5.2.17, and SQL Engine: MySQLi 5.1.67.
Probably the hostname is invalid, I don't think you can specify a hostname and a socket together.
(2013-02-26, 09:37 AM)StefanT Wrote: [ -> ]Probably the hostname is invalid, I don't think you can specify a hostname and a socket together.

Thanks for the response. I've spent the last hour chewing the ear off the support guys at 1and1, and in the end they experimented with the script until they worked out what was getting in the way. Apparently the line

$config['database']['type'] = 'mysqli';

needed to be

$config['database']['type'] = 'mysql';

It's now working, as far as I can see, but I'll update this thread if I encounter any further problems with it. Thanks again for checking this out.