I've moved my Craft 3 installation to a new server.
When connecting to the original database, everything works fine.
However, when trying to connect to a new MySQL database (I've tried hosting this on both the new server and RDS) I'm getting the error: Access denied for user
. I migrated to the new database by exporting via the Craft CP and then importing to the new database via MySQL Workbench.
I've tried connecting to both servers using a vanilla PHP connection (i.e. new mysqli(host, username, password)
and it works perfectly fine -- I can even query the database and return results.
I only run into this error when the connection is opened by the original Craft index.php
(the one with the $app->run()
command). I've checked the output of the (new Dotenv\Dotenv(CRAFT_BASE_PATH))->load();
line and it does properly return the settings defined in .env
, which are the same as the ones used in the vanilla connection I mentioned above.
The side-effect of this error in storage/logs/phperrors.log
is Allowed memory size of <memory_limit> bytes exhausted ... in /var/www/craft/vendor/yiisoft/yii2/db/Connection.php
.