MyBB Community Forums

Full Version: SQL issue ERROR 0
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
MyBB has experienced an internal SQL error and cannot continue.
SQL Error:0 -Query:[READ] Unable to select database
If you're a visitor of this website, please wait a few minutes and try again. If this problem persists, please [[email protected]]contact the site owner[/email].
If you are the site owner, please check the MyBB Documentation for help resolving common issues, or get technical help on the MyBB Community Forums.

Godaddy and i spent HOURS today checking everything on my site at
VetsLink Forums - Internal Error

db's check ok, i'm lost! is there a php or two i could download to keep my threads and posts, then delete mybb via uninstall, reinstall it the copy the old thread/post php back in so i dont lose anything? My site is a 501c3 for helping veterans so i REALLY don't want to lose what is already posted. i'm on current version of MyBB. i'm getting spammed mercilessly with notices via email that say:
Your copy of MyBB running on VetsLink Forums (https://vetslink.org/forum2) has experienced an error. Details of the error include:

---
Type: 20
File:  (Line no. 0)
Message
SQL Error: 0 -
Query: [READ] Unable to select database
Back Trace: #0  errorHandler->email_error(20, SQL Error: 0 -
Query: [READ] Unable to select database, , 0) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/inc/class_error.php:229]
#1  errorHandler->error(20, Array ([error_no] => 0,[error] => ,[query] => [READ] Unable to select database)) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/inc/db_mysqli.php:601]
#2  DB_MySQLi->error([READ] Unable to select database, mysqli Object ([affected_rows] => ,[client_info] => ,[client_version] => ,[connect_errno] => ,[connect_error] => ,[errno] => ,[error] => ,[error_list] => ,[field_count] => ,[host_info] => ,[info] => ,[insert_id] => ,[server_info] => ,[server_version] => ,[sqlstate] => ,[protocol_version] => ,[thread_id] => ,[warning_count] => )) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/inc/db_mysqli.php:285]
#3  DB_MySQLi->select_db(i7859561_mb2) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/inc/db_mysqli.php:266]
#4  DB_MySQLi->connect(Array ([type] => mysqli,[database] => i7859561_mb2,[table_prefix] => mb_,[hostname] => localhost,[username] => i7859561_mb2,[password] => V.Q54nEG3lOkXY5eM5J78,[encoding] => utf8)) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/inc/init.php:172]
#5  require_once(/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/inc/init.php) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/global.php:20]
#6  require_once(/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/global.php) called at [/home/wxqx4ld9pmdy/public_html/vetslink.org/forum2/index.php:18]
thanks
just a short question: do you create backups on a regular base ?
(like I think you can do easily with the tools already inside the MyBB backend)

and can you access everything on the backend ?
Quote:is there a php or two i could download to keep my threads and posts, then delete mybb via uninstall, reinstall it the copy the old thread/post php back in so i dont lose anything?

There is no point in doing this, all installing the forum does is create the database tables, so if you install a fresh forum and restore a backup, you'd end up with the same database you had in the first place.

The error you're getting is either due to your database hostname or name being incorrect in inc/config.php, or is an issue with the host.mIf it has spontaneously happened without you doing anything, then it suggests an issue with the host. Double check the database hostname is still correct, and that they haven't moved your database to a new server or something.
(2022-06-27, 09:58 AM)silenzioso Wrote: [ -> ]just a short question: do you create backups on a regular base ?
(like I think you can do easily with the tools already inside the MyBB backend)

and can you access everything on the backend ?

i have no access to MyBB, attempting to log into admin gives same message, i tried using my backup and get same message using my cpanel from godaddy. i can use the phpmyadmin and tried creating new user with it as i saw in another thread with same result. Hence my wondering about downloading sections that contain posts and threads, reinstalling MyBB then overwriting

(2022-06-27, 10:49 AM)Matt Wrote: [ -> ]
Quote:is there a php or two i could download to keep my threads and posts, then delete mybb via uninstall, reinstall it the copy the old thread/post php back in so i dont lose anything?

There is no point in doing this, all installing the forum does is create the database tables, so if you install a fresh forum and restore a backup, you'd end up with the same database you had in the first place.

The error you're getting is either due to your database hostname or name being incorrect in inc/config.php, or is an issue with the host.mIf it has spontaneously happened without you doing anything, then it suggests an issue with the host. Double check the database hostname is still correct, and that they haven't moved your database to a new server or something.

$config['database']['type'] = 'mysqli';
$config['database']['database'] = 'i7859561_mb2';
$config['database']['table_prefix'] = 'mb_';



its calling for same database

thanks again
Quote:Hence my wondering about downloading sections that contain posts and threads, reinstalling MyBB then overwriting

The issue is with connecting to the database, not with the database itself, so there won't be any need to do anything with any backups.

Quote:its calling for same database

If the database name is correct, check the hostname is correct, or ask GoDaddy if it's correct. If they've moved your database to a new server, you'd need to update your config file to reflect the new hostname.
(2022-06-27, 02:48 PM)Matt Wrote: [ -> ]
Quote:Hence my wondering about downloading sections that contain posts and threads, reinstalling MyBB then overwriting

The issue is with connecting to the database, not with the database itself, so there won't be any need to do anything with any backups.

Quote:its calling for same database

If the database name is correct, check the hostname is correct, or ask GoDaddy if it's correct. If they've moved your database to a new server, you'd need to update your config file to reflect the new hostname.

somehow, someway there was no username associated i could see under myphpadmin, so i simply put in the privileged user and forum was back!
thanks for your help and patience
RESOLVED