[Resolved] Access denied for user ''@'localhost' (using password: NO)


#1

Hi all,

I wonder if someone could help me troubleshoot my problem. Having been an Omeka Classic user, I now downloaded Omeka S version 1.2.0. I copied it to /www/html, set directory privileges as required; created SQL database and granted privileges to user; entered database details in config/database.ini; added the necessary settings in Apache2’s sites-enabled. .htaccess settings are default with the exception that I changed environment to developer. Ubuntu 18.04. When I go to localhost/[my omeka s installation]/install, I get the error message in the title.

I have triple checked that Apache, PHP & modules and Mysql are at least the required versions; restarted mysql multiple times; triple checked all the settings. I can access the database I created with the credentials I entered in database.ini from command line without issue. If I purposefully put wrong details in database.ini, the error message does not change. Mysql error log does not say anything beyond the “access denied” message. The Omeka Classic installations I have in the same location (/www/html) work without issue.

In sum, it looks as if the installation thinks database.ini is empty.


#2

To check if the issue is related to the installation of php, download adminer (a one file phpmyadmin) on your localhost, and try it.


#3

In sum, it looks as if the installation thinks database.ini is empty.

That’s what I would guess is the issue… given the error message indicates it didn’t try to connect with a user name or a password.

Have you checked the file permissions on the database.ini file (and the config folder)? Perhaps the server simply can’t open that file… though I believe we’d throw an error in that case.

Can you post the whole database.ini file? (you can replace with x’s or whatever your actual credentials). It’s possible that there’s a stray character or something like that that’s preventing us from parsing the file properly.


#4

Thank you for the replies. My database.ini has just the basics:

user = “xxxxxx”
password = “xxxxxxxx”
dbname = “julkaisut”
host = “localhost”

These SHOULD be enough for my setup. Apache has read and write access to the config folder as well as the files inside. I even tried 777, which did not change things. Adminer does not show any issues. I’ve tried PHP versions 7.0, 7.1 and 7.2. Mysql is version 5.7.23. Have not tested other versions yet.


#5

Okay, I have no idea what was originally wrong. But I deleted v1.2.0, put v1.1.0 in its place, then copied v1.2.0 over it. Now it works.


#6

It’s hard to see the difference but it looks like several of the quotation marks in your database.ini you posted got changed to “smart” or “curly” quotes, which could definitely cause this kind of problem.