I get a SQLSTATE[28000] [1045] Access Denied
error every time I try to connect my ownCloud instance to my MySQL database as <user>@localhost
. This is on a clean, newly installed copy of Ubuntu server with a LAMP stack. After going round the following steps I've tried already to debug this problem I have tried a clean install from scratch and still get no luck (also trying all the below steps).
Things I've tried:
- Initially using a newly created user
owncloud
with a random character password and using that (user had been granted access to the database and privileges had been flushed). - Logging on in a terminal using
mysql -u owncloud -p
, works perfectly fine. - Logging on like the above but with
-h localhost
, also works fine. - Trying for testing's sake to setup owncloud with my root MySQL user.
- Logging on in a terminal using
mysql -u root -p -h localhost
, plus of course without the-h localhost
too. - Using
127.0.0.1
instead oflocalhost
forroot
andowncloud
users. - Using a previous version of ownCloud (8.2.2 and 8.2.3 instead of 9.0.0).
- Reusing a previous config file from another ownCloud instance (which I'm trying to replicate on this new server to take the old one's place) but that causes an internal server error - most likely due to not being able to access the database.
- Replacing all files in the
/var/www/owncloud
directory with Drupal 8 - creating a test site in Drupal using the same MySQL user and table (owncloud
for both) and this bizarrely works. - Taking an SQL dump and a copy of the files in
/var/www/owncloud
from the old server, putting them on the new server and it connects to the database fine (majorly flawed though because I have a largedata
directory so I didn't copy that over, I could try that though if I have to but that wasn't the point of this test).
I've run entirely out of ideas, tried lots of Googling about specifically this error on ownCloud and this error generally but they all seem to be people not setting passwords correctly or forgetting passwords. I know my passwords are indeed correct because they work in a terminal (and I've used exact copy & paste).
For those interested, I'm using: Ubuntu 14.04.3 LTS 64-bit, PHP5, MySQL V14.14 D5.5.47 and ownCloud 9.0.0.
Any new ideas of things to try are very welcome! Thanks :)