MyBB Community Forums

Full Version: MyBB experienced an internal SQL error [solved]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I have MyBB 1.4.13. I do not install it on a desktop PC, but on my phone.
My phone's server: PHP 5.2.2, MySQL 5.0.67. I am not going to use it as a server, just to test when i am not home, but mybb seems to be unable to install..
I get to the last step(and i mean the last). And after "Bulding administrator permissions....done"

I get an error: MyBB experienced an internal SQL error and cannot continue.

I think the problem comes from this code onwards

	// Automatic Login
	my_unsetcookie("sid");
	my_unsetcookie("mybbuser");
	my_setcookie('mybbuser', $uid.'_'.$loginkey, null, true);
	ob_end_flush();

	// Make fulltext columns if supported
	if($db->supports_fulltext('threads'))
	{
		$db->create_fulltext_index('threads', 'subject');
	}
	if($db->supports_fulltext_boolean('posts'))
	{
		$db->create_fulltext_index('posts', 'message');
	}

	// Register a shutdown function which actually tests if this functionality is working
	add_shutdown('test_shutdown_function');

	echo $lang->done_step_cachebuilding;
	require_once MYBB_ROOT.'inc/class_datacache.php';
	$cache = new datacache;
	$cache->update_version();
	$cache->update_attachtypes();
	$cache->update_smilies();
	$cache->update_badwords();
	$cache->update_usergroups();
	$cache->update_forumpermissions();
	$cache->update_stats();
	$cache->update_forums();
	$cache->update_moderators();
	$cache->update_usertitles();
	$cache->update_reportedposts();
	$cache->update_mycode();
	$cache->update_posticons();
	$cache->update_update_check();
	$cache->update_tasks();
	$cache->update_spiders();
	$cache->update_bannedips();
	$cache->update_banned();
	$cache->update_birthdays();
	$cache->update("plugins", array());
	$cache->update("internal_settings", array('encryption_key' => random_str(32)));
	echo $lang->done . '</p>';

	echo $lang->done_step_success;

	$written = 0;
	if(is_writable('./'))
	{
		$lock = @fopen('./lock', 'w');
		$written = @fwrite($lock, '1');
		@fclose($lock);
		if($written)
		{
			echo $lang->done_step_locked;
		}
	}
	if(!$written)
	{
		echo $lang->done_step_dirdelete;
	}
	echo $lang->done_subscribe_mailing;
	$output->print_footer('');
}

function db_connection($config)
{
	require_once MYBB_ROOT."inc/db_{$config['database']['type']}.php";
	switch($config['database']['type'])
	{
		case "sqlite3":
			$db = new DB_SQLite3;
			break;
		case "sqlite2":
			$db = new DB_SQLite2;
			break;
		case "pgsql":
			$db = new DB_PgSQL;
			break;
		case "mysqli":
			$db = new DB_MySQLi;
			break;
		default:
			$db = new DB_MySQL;
	}
	
	// Connect to Database
	define('TABLE_PREFIX', $config['database']['table_prefix']);

	$db->connect($config['database']);
	$db->set_table_prefix(TABLE_PREFIX);
	$db->type = $config['database']['type'];
	
	return $db;
}

function error_list($array)
{
	$string = "<ul>\n";
	foreach($array as $error)
	{
		$string .= "<li>{$error}</li>\n";
	}
	$string .= "</ul>\n";
	return $string;
}

function write_settings()
{
	global $db;
	
	$query = $db->simple_select('settings', '*', '', array('order_by' => 'title'));
	while($setting = $db->fetch_array($query))
	{
		$setting['value'] = str_replace("\"", "\\\"", $setting['value']);
		$settings .= "\$settings['{$setting['name']}'] = \"{$setting['value']}\";\n";
	}
	if(!empty($settings))
	{
		$settings = "<?php\n/*********************************\ \n  DO NOT EDIT THIS FILE, PLEASE USE\n  THE SETTINGS EDITOR\n\*********************************/\n\n{$settings}\n?>";
		$file = fopen(MYBB_ROOT."inc/settings.php", "w");
		fwrite($file, $settings);
		fclose($file);
	}
}

function test_shutdown_function()
{
	global $db;
	
	$db->update_query("settings", array('value' => 1), "name='useshutdownfunc'");
	write_settings();
}

And more specificaly, the shutdown function(or maybe cache? ). Can someone help?
Let me get this straight, you're installing MyBB on you're phone?
Call me crazy, but I think you're getting that error because you're phone wouldn't have MySQL ?
If it didn't have MySQL it wouldn't have Apache, moreover PHP and i would not even get parsed code...i stated my server configuration!!
Moved to the support forums in MyBB plugins.
Why is it moved in plugins? I do not need plugin support. The piece of code in the beginning is from index.php of the installer. This is surely for general support

Just to clarify i am not making a plugin
Odd setup, but anyway...

Does it literally just say 'MyBB experienced an internal SQL error and cannot continue' and nothing else?? No query or other error?? I can only remember one time when this is all it said, I'll try and find the thread.
No query, no nothing. Just that message!
how did you manage to install it on your phone? Confused
Google PAMP. That is your answer!
(2010-06-22, 07:23 PM)DotMRT Wrote: [ -> ]how did you manage to install it on your phone? Confused

http://wiki.opensource.nokia.com/projects/PAMP

Smile

OT-

This has happened to me before, I restarted MySQL and it worked.
Pages: 1 2