MyBB Community Forums

Full Version: MyBB not connecting to mysql database
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have installed myBB on my server(aws ec2), when i add my mysql database credentials(its correct), it says
Quote:
There seems to be one or more errors with the database configuration information that you supplied:
Could not connect to the database server at 'localhost' with the supplied username and password. Are you sure the hostname and user details are correct? Once the above are corrected, continue with the installation.
Even tho the credentials are correct
p.s I have not set any password for mysql
screenshot: Check the error message and other details have entered
(2019-12-23, 12:58 PM)pixomaryt Wrote: [ -> ]I have installed myBB on my server(aws ec2), when i add my mysql database credentials(its correct), it says
Quote:
There seems to be one or more errors with the database configuration information that you supplied:
Could not connect to the database server at 'localhost' with the supplied username and password. Are you sure the hostname and user details are correct? Once the above are corrected, continue with the installation.
Even tho the credentials are correct
p.s I have not set any password for mysql
screenshot: Check the error message and other details have entered
Hey, 
do you have all the required PHP extensions? If so, it should be working fine. Are you 100% sure everything is correct and the mysql service is running?
Quote:p.s I have not set any password for mysql
a password is required for the database. leaving it blank might not work !
https://www.php.net/manual/en/mysqli.construct.php about mysqli::_construct (also applied to mysql_connect that is used by MyBB) says:
Quote:passwd

    If not provided or NULL, the MySQL server will attempt to authenticate the user against those user records which have no password only. This allows one username to be used with different permissions (depending on if a password is provided or not).
Seems for mysqli_connect, it's different from mysql_connect where PHP will try to use no password if an empty string is passed.

So, as @.m. has suggested, set a password for your user.

However, MyBB should have made it clear whether or not an empty password for database is applicable.


OK. I tried installing a MyBB instance on PHP 7.1.33 + MySQL 5.7.28 (with mysqli) on Windows, with an empty password. It's working.

Will OP try to check if that user has relevant privileges on that database?