MyBB Community Forums

Full Version: Moving MyBB to new MySQL Server Problems
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently I have MyBB installed on same Server as MySQL 5.7.33 – no problems.

I setup a new installation of MySQL 8 on a new Server on the same internal Network.

1) Created a new Schema/Database and assigned a new User Account to it (the Schema, Database and User Account names are the same as the old Server).
2) Exported Database from old Server to new Server without error.
3) Ensured that Port 3306 opened on new Server.
4) Modified CONFIG.PHP from LOCALHOST to IP Address of new MYSQL Server.

I get the following error when updating CONFIG.PHP as above:
“MyBB has experienced an internal SQL error and cannot continue.”

When I attempt to do a clean install to the new MySQL Server I get an authentication (Username/Password) error and can’t continue.

When I Telnet to the new Server it prompts for Username but a few seconds later it disconnects with “Packets out of order” and drops the connection.

I can’t find clear instructions on setting up MySQL with MyBB here so I am resorting to the expertise of the community to assist.

I am sure I am missing the obvious but I have gone off on so many tangents trying to digest MySQL documents that it’s substantially dissolved my brain.

Any help to guide in the right direction would be greatly appreciated.
Probably an error with your user: did you well set the host it uses ? It's not localhost but the IP of your front server.
And your port 3306 is open, ok, but is your my.cnf (or any mariadb conf file) is well configured (comment bind-address directive) ?
It sounds more like an issue with the MySQL installation itself than anything to do with MyBB if it's saying the username and password are wrong and the connection is dropping. Can you connect to MySQL from a GUI application, or via SSH?
I didn't mention it, but my hypothesys about user was mysql sided Smile
Thanx Matt

Yes, it is an obvious MySQL 8 issue on the new Server as MyBB works well on the current MySQL 5.7.33 Server.

I tried to SSH to the current Server for comparison but it too fails to connect even though MyBB is working just fine so don't really know how to properly run a test that is relevant (been using Putty on Port 3306 even on the local host itself).

I have now completely removed SQL 8 (for the fifth time). Just waiting for pending Windows Updates to finish installing before I reboot the Server and try again.

(2021-02-27, 10:39 PM)Crazycat Wrote: [ -> ]I didn't mention it, but my hypothesys about user was mysql sided Smile

Thanx Crazycat
Yes, I have verified that bind-address is correct (bind-address=0.0.0.0Wink and that User that is bound to the Database can connect from anywhere (%).
Updating MyBB to use Root account results in the same errors.
It's as if MySQL is refusing to listen.
As mentioned to Matt, I am in the process of re-installing MySQL 8 (again). If I encounter the same issue I will host MyBB on the same Server as a test (as the current configuration is working well with MyBB and MySQL on the same Server).
Here's an update since posting:

Description:
Server A - New MySQL 8
Server B - Current MySQL 5.7 with IIS Hosting Websites/Forum

Outcome:
[Original Issue] Updating config.php on Server B to point to Database on new Server A results in error: “MyBB has experienced an internal SQL error and cannot continue.” On both forum and ACP.

As a test, I installed IIS on Server A and successfully installed MyBB and imported Database from Server B. All working well.
Then updated config.php on Server A to point to Database on Server B and all works well.
Simply put; Server B throws a wobbly if I point the forum Database to Server A.

Summary:
The new (Server A) MySQL is working fine and is accessible outside of “local host” with successful SQL Connection tests (sql -u username -h IPofServerA -p).
Server A’s MySQL error log (SERVERA.ERR) is clean.

So, all indications are that this is NOT a MySQL issue but some other underlying dependency somewhere or MyBB would not work as it does and as explained in “Outcome” above.

Gotta be missing something really obvious somewhere – PHP perhaps? If where/what?
So, from serverB, you can reach the MySQL on serverA using sql -u username -h IPofServerA -p ?

I didn't hear about php refusing to connect to an external server. Did you well set the 'username'@'%' rights on MySQL and on the MyBB database ? What is the result of a show grants for 'username'@'%'; ?
You might be better off asking on Stackoverflow or ServerFault to be honest, this issue doesn't sound specific to MyBB, all we use is the standard inbuilt mysqli_* functions. Maybe try setting up a test PHP script on the new server separate from MyBB and create a connection in there, so take MyBB out of the equation until the test script can connect with the credentials you need.
(2021-03-18, 07:41 AM)Crazycat Wrote: [ -> ]So, from serverB, you can reach the MySQL on serverA using sql -u username -h IPofServerA -p ?

I didn't hear about php refusing to connect to an external server. Did you well set the 'username'@'%' rights on MySQL and on the MyBB database ? What is the result of a show grants for 'username'@'%'; ?

Yes, correct, I can reach both MySQL Servers from each other with the above command.
Yes, user account (not root) grants full access to Database from '%'.
I'll try deleting the account and re-create it with phpmyadmin - maybe something sinister going on when creating accounts with Workbench.

I'll keep posting updates here for anyone who may find themselves in the same situation.