Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database connection access denied with Joomla 3.8 (when in detail view) #18204

Closed
schultz-it-solutions opened this issue Oct 3, 2017 · 12 comments

Comments

@schultz-it-solutions
Copy link
Contributor

schultz-it-solutions commented Oct 3, 2017

I am experiencing a strange issue since update to 3.8 with my database user.
The website is generally working fine (so username and password for the database user are set correctly).
In the backend, when I unpublish a menu item (from the "menu items list" of the menu) by clicking on the "status" icon, the menu item gets unpublished as expected.

when I open the menu item details page and select the "unpublish" option from the "status" select list, I am receiving an mysql error "1044 Access denied for user ..."
(this also happens with other elements as articles and probably others as well).

Steps to reproduce the issue

Create a joomla instance with a database where "database name" and "user_name" both start with the same prefix as the "database table prefix" (whether this is relevant is just my guess)
Open a menu item detail view and try to change the status, then "save" or "save and close"

Expected result

Change is stored to the database

Actual result

1044 Access denied for user '#__mydatabase'@'%' to database '#__mydatabase'
...\httpdocs\libraries\joomla\database\driver\mysqli.php:650

System information (as much as possible)

PHP 7.1.9, Apache 2.4.25, Joomla 3.8.0
Database 5.5.5-10.2.6-MariaDB
database name is "jms_mydatabase"
database username is "jms_mydatabase"
database table prefix is "jms_"

Additional comments

Indeed there is no user #_mydatabase and no database #mydatabase on the server, so the MySQL error message is "understandable", however it looks to me as if the "table prefix" is not rendered from # to jms in these circumstances.

Any ideas?

@alikon
Copy link
Contributor

alikon commented Oct 3, 2017

are you able to change state/save others items (e.g articles , contacts , categories etc)
are you experiencing this only with menus?

@schultz-it-solutions
Copy link
Contributor Author

On "articles" I get the same error, but as a "Joomla Error" message (in "menu component" I get the "An error has occurred. return to control panel." error

@schultz-it-solutions
Copy link
Contributor Author

On "article categories" I get the same "system error" message as with menu items.

but on both, I can successfully change the status in the "list of elements view"

@tonypartridge
Copy link
Contributor

I cannot recreate this. Can you try reinstalling core files? Joomla updater and click reinstall core files.

@brianteeman
Copy link
Contributor

also check the database permissions of your database user

@schultz-it-solutions
Copy link
Contributor Author

Thanks brian, I was expecting this comment from someone. But please note that I actually can do all this stuff from the "list view" of the menu items or the articles or the categories. So as I stated at the very top, the database user configuration actually IS correct.

It is only in the named circumstances where the connection "seems" to fail - however, what I now found out is, that DESPITE the MySQL error message, at least for content changes in articles, the change actually IS STORED in the database

@mbabker
Copy link
Contributor

mbabker commented Oct 4, 2017

Unfortunately your best first troubleshooting step is going to be checking the permissions. Especially as 1044 Access denied for user isn't a core Joomla message. So it could well be that your user has permissions for some query types that allows things to save correctly but not other types which are used in other ways and causes you to see the error message.

Try setting the site to debug mode and enabling all logging (debug and log plugins). If you get the error message again, you should be able to find the query that it is failing on and that would also help debug this issue.

@schultz-it-solutions
Copy link
Contributor Author

will do some investigation indeed...

@brianteeman
Copy link
Contributor

I am going to close this for now as everything points to it being a local database issue and not a joomla issue. If you find that it is in fact Joomla it can always be reopened

@schultz-it-solutions
Copy link
Contributor Author

Found the issue, not connected to Joomla (sorry to bother you).
in the aftermath of updating to Joomla 3.8.0, we had an incident where all database users were crashed in the mysql users table. In restoring them, we missed to also grant the "LOCK TABLES" and "REFERENCES" database permissions. These seem to be relevant only in the named circumstances, and not "whenever changes are made"...

@brianteeman
Copy link
Contributor

Glad you discovered the issue and it was as suspected

@fjcantais
Copy link

I am having this issue running Joomla! 3.8.1 using MySQL 5.5.41-0+wheezy1 and PHP 5.4.45-0+deb7u11
When trying to empty menu items trash I am getting the following message:
Access denied for user 'myuser'@'XXX.XXX.XXX.188' to database 'mydatabase'
But in fact this is not the right IP, this is the IP of the web server running Joomla!, while MySQL is running on XXX.XXX.XXX.179, which is the value correctly configured in configuration.php
Got the same error performing other operations like uninstalling an extension or saving a new article (although, in this case, the article is saved anyway)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants