2

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:

  1. 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).
  2. Logging on in a terminal using mysql -u owncloud -p, works perfectly fine.
  3. Logging on like the above but with -h localhost, also works fine.
  4. Trying for testing's sake to setup owncloud with my root MySQL user.
  5. Logging on in a terminal using mysql -u root -p -h localhost, plus of course without the -h localhost too.
  6. Using 127.0.0.1 instead of localhost for root and owncloud users.
  7. Using a previous version of ownCloud (8.2.2 and 8.2.3 instead of 9.0.0).
  8. 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.
  9. 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.
  10. 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 large data 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 :)

Jamie Scott
  • 141
  • 5
  • I never actually solved this. I found a workaround by just importing my old instance. Works fine but if I try to start afresh I get the same issues. – Jamie Scott Apr 19 '16 at 14:04

0 Answers0