New install of 10.0.3 cannot connect to database

Setting up a new OwnCloud server on Ubuntu Server 16.04. Followed the manual install instructions to the letter, but cannot connect to the database. It makes no difference if the owncloud database is created in mariadb first or not.

The message on the owncloud setup page is "Error while trying to create admin user: Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused"

Any help is appreciated. Thanks.


what manual were you following?

are you sure your db is running?

Did you create a user to login into the database with the right permissions?

Thanks for the quick response.

It used this:

Got it working. The trick was granting the database user account full rights from both localhost and Once that was done, and the hostname was set to in the setup screen, the setup went smoothly.

Got that idea from reading some other things online. Seems to be a recurring problem with MySQL. But it's working now!