MyBB Community Forums

Full Version: [READ] Unable to connect to MySQL server
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I dumped wamp+phpmyadmin and installed mysql workbench for more control.
There is a problem though, the new forum database is at a different file location in the server, which, when connecting to the forum website, I get this message.

I know the website is alive, its just that the forum site files are not communicating with the SQL database because idk what i need to change in the "inc" or something to make it connect.
Yes the SQL server is online.. and the computer is plugged in.. lol
Any ideas?

MyBB SQL Error
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
2002 - php_network_getaddresses: getaddrinfo failed: No such host is known.
Query:
[READ] Unable to connect to MySQL server
Please contact the MyBB Group for support.
Make sure the database settings in the inc/config.php file are correct.
ah yes, that worked. I was messing with settings.php this whole time.
Now I ran into a new problem.

SQL Error:
1130 - Host 'ns237064' is not allowed to connect to this MySQL server
Query:
[READ] Unable to connect to MySQL server
Make sure you added the database user to your forum database and use grant statements to give it the privileges it needs.
I got confused by that just now.
Would you be more specific on that?
"database user to your forum database"

I'll be specific as I can from what I'm seeing.
I'm in the SQL Workbench, the forum's database is added. Under Users & Privilages, the user is "root" with a password, and i gave it all the database priviliages.

Forum config.php
$config['database']['type'] = 'mysql';
$config['database']['database'] = 'subglobal';
$config['database']['table_prefix'] = 'mybb_';

$config['database']['hostname'] = 'THE IP';
$config['database']['username'] = 'root';
$config['database']['password'] = 'THE PASSWORD';

the account is the same account and password that mySQL Workbench is using.

I am still getting the error:
SQL Error:
1130 - Host 'ns237064' is not allowed to connect to this MySQL server
____________________

UPDATE:
Okay, i am now able to view the forum by replaceing "THE IP" with "localhost".

Now I ran into another problem; I am unable to post on the forum.
When I post on the forum, it actually will not post, it takes me to an error page:

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1364 - Field 'posthash' doesn't have a default value
Query:
INSERT INTO mybb_posts (`tid`,`replyto`,`fid`,`subject`,`icon`,`uid`,`username`,`dateline`,`message`,`ipaddress`,`longipaddress`,`includesig`,`smilieoff`,`visible`) VALUES ('480','937','25','RE: MINECRAP MAP!!!!!','0','1','JesusChrist','1406421873','test\r\n\r\n ','108.162.238.228','1822617316','0','0','1')

\\\\\\\\\\

I've tried installing an updated version of mybb (from 1.6.10 to 1.6.14) and when i click install > install from 1.6.10 to 1.6.10 > enter, I get the following:
MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1364 - Field 'status' doesn't have a default value
Query:
INSERT INTO mybb_templates (`title`,`template`,`sid`,`version`,`dateline`) VALUES ('post_attachments_add','<input type=\"submit\" class=\"button\" name=\"newattachment\" value=\"{$lang->add_attachment}\" tabindex=\"13\" />','-2','1614','1406422275')

What is all this talk about, "doesn't have a default value" ?

\\\\\\\\\\\\\\\\\\\\

Update - did more independant research. posting this for others who find this on Google.

to fix the "doesn't have a default value" errors, it means MySQL is in strict mode, you must go into the my.ini file and edit it.

Change this:
# Set the SQL mode to strict 
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

To this:
sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
(2014-07-26, 01:14 PM)dragonexpert Wrote: [ -> ]Make sure the database settings in the inc/config.php file are correct.

Ummmmm the same message is appearing when I try to connect to a Forum (hack forums.net) but on my iPad?? Not sure what to do