Nextcloud Setup fails with SQLSTATE[HY000][1045] Access denied

Nextcloud is an excellent alternative to public clouds like Gdrive (Google), Dropbox or OneDrive (Microsoft).  It gives you full control over your data and you don’t have to rely on privacy promises of commercial providers. You can also choose the location of your hosting server and make sure your data isn’t in the reach of foreign authorities.

Simple setup

Setting up a Nextcloud server is pretty simple. Upload an installer PHP-File into your webspace, crate a database and a database user and point a browser to the setup-nextcloud.php file.

It’s that simple!

Access denied

In the next step you are asked to define an administrator and a password and enter database name and database user credentials.  That’s the moment when some people get the message:

Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user ‘mydbadmin’@’localhost’ (using password: YES)

I’ve tried a lot of things to get rid of that issue (the web is full of snakeoil advices). But none of them helped.

Stupid simple

Believe me, the solution is simple but crazy. A moment when you feel like Homer Simpson…. “D’oh!”

There are textboxes where you enter your passwords and on the right hand side of these boxes there’s an icon to un-hide the password.

Usually one would unhide the entered passwords and take a screenshot for documentation purposes. If you click Next to finish your installation you’ll most likely end up with the error message above. But if you hide your passwords before proceeding, everything will be fine. So simple. Don’t ask me why, but it works and I’m happy.


Leave a Reply

Your email address will not be published. Required fields are marked *