MyBB Community Forums

Full Version: MySQL Error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am having a MySQL error when attempting to go onto my forums. It's just not working.

Now, it says that it isn't able to connect to mysql4, the SQL database of mine. Thing is that nothing has been tampered with. I use MyBB 1.4.1 since 1.4.2 wasn't downloading. I noticed this problem today. Yesterday, it was working perfectly.

Now, my forums URL is http://thepokemon.freehostia.com/forums/

Screenshot:
click here
Are you sure "mysql4" is your database host or the name of your database? You should check with your webhost to make sure your database login information is correct.
As you seem to be on a free host, the database name will probably be 'thepokemon', that's generally how they work. Either that or 'thepokemon' will be the database username.

If you PM me the log in details of your control panel I can check your info' for you.
It is a free host, called FreeHostia. I'm, though, 100% sure the database name is mysql4, since it worked for a few weeks.

Oh wait, it's the database server's name, as shown here:
[Image: mysql4.png]

The database username is johmcc285_cult. I think I had tried that when making the forums, but nothing worked besides mysql4.

But just in case, is there a way I can be able to change the database name? o I have to use phpMyAdmin or like something?
Can you paste the details of the database section of ./inc/config.php?? Leave out the password though.

Calling the database mysql4 isn't technically wrong, it's like keeping you forum in /Upload/, it will technically work but just isn't advisable.
Ok...

<?php
/**
 * Database configuration
 *
 * Please see the MyBB Wiki for advanced
 * database configuration for larger installations
 * http://wiki.mybboard.net/
 */

$config['database']['type'] = 'mysql';
$config['database']['database'] = 'johmcc285_cult';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'mysql4';
$config['database']['username'] = 'johmcc285_cult';
$config['database']['password'] = 'PASSWORD REMOVED';

/**
 * Admin CP directory
 *  For security reasons, it is recommended you
 *  rename your Admin CP directory. You then need
 *  to adjust the value below to point to the
 *  new directory.
 */

$config['admin_dir'] = 'admin';

/**
 * Hide all Admin CP links
 *  If you wish to hide all Admin CP links
 *  on the front end of the board after
 *  renaming your Admin CP directory, set this
 *  to 1.
 */

$config['hide_admin_links'] = 0;

/**
 * Data-cache configuration
 *  The data cache is a temporary cache
 *  of the most commonly accessed data in MyBB.
 *  By default, the database is used to store this data.
 *
 *  If you wish to use the file system (cache/ directory), MemCache or eAccelerator
 *  you can change the value below to 'files', 'memcache' or 'eaccelerator' from 'db'.
 */

$config['cache_store'] = 'db';

/**
 * Memcache configuration
 *  If you are using memcache as your data-cache,
 *  you need to configure the hostname and port
 *  of your memcache server below.
 *
 * If not using memcache, ignore this section.
 */

$config['memcache_host'] = 'localhost';
$config['memcache_port'] = 11211;

/**
 * Super Administrators
 *  A comma separated list of user IDs who cannot
 *  be edited, deleted or banned in the Admin CP.
 *  The administrator permissions for these users
 *  cannot be altered either.
 */

$config['super_admins'] = '1';

/**
 * Database Encoding
 *  If you wish to set an encoding for MyBB uncomment 
 *  the line below (if it isn't already) and change
 *  the current value to the mysql charset:
 *  http://dev.mysql.com/doc/refman/5.1/en/charset-mysql.html
 */

$config['database']['encoding'] = 'utf8';

/**
 * Automatic Log Pruning
 *  The MyBB task system can automatically prune
 *  various log files created by MyBB.
 *  To enable this functionality for the logs below, set the
 *  the number of days before each log should be pruned.
 *  If you set the value to 0, the logs will not be pruned.
 */

$config['log_pruning'] = array(
	'admin_logs' => 365, // Administrator logs
	'mod_logs' => 365, // Moderator logs
	'task_logs' => 30, // Scheduled task logs
	'mail_logs' => 180, // Mail error logs
	'user_mail_logs' => 180, // User mail logs
	'promotion_logs' => 180 // Promotion logs
);
 
?>
(2008-09-26, 08:56 PM)Cultred Wrote: [ -> ]Oh wait, it's the database server's name, as shown here:
[Image: mysql4.png]

The database username is johmcc285_cult. I think I had tried that when making the forums, but nothing worked besides mysql4.

But just in case, is there a way I can be able to change the database name? o I have to use phpMyAdmin or like something?

From that, your settings should be:

$config['database']['type'] = 'mysql'; // could also be mysqli
$config['database']['database'] = 'this is your database name';
$config['database']['hostname'] = 'mysql4.freehostia.com';
$config['database']['username'] = 'johmcc285_cult';
$config['database']['password'] = 'your password';
I also need the table prefix, don't I?
Yep, you can leave that to whatever you had before (also the database type)
Thanks, it's working Smile

I'm saved!
Pages: 1 2