[MXS-2482] Can't connect to information_schema database Created: 2019-05-13 Updated: 2019-05-28 Resolved: 2019-05-28 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | N/A |
| Affects Version/s: | None |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Nicolas Bigler | Assignee: | Todd Stoffel (Inactive) |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I'm currently struggling with maxscale when trying to connect to the information_schema database. I'm able to connect to this special database when connecting to the database server directly:
However I can't connect to the database when going through maxscale:
What does work is to connect to the database first (via maxscale)
I don't quite understand why it doesn't work directly. The following PHP script shows the same issue:
The maxscale log file (with log_info=1) shows the following:
There is nothing regarding failed authentication in the logs on the db server itself. My assumption: The `information_schema` database is a special case in mysql/mariadb where the some GRANTS (eg. SELECT, CONNECT) are implicitly granted to every user and are not listed when using `SHOW GRANTS` Maxscale first receives a list of GRANTS for the user and determines that the user does not have access to the `information_schema` database and therefore rejects the connection, even though the user has access. |
| Comments |
| Comment by Todd Stoffel (Inactive) [ 2019-05-14 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This looks like a permissions problem. Can you please show the grants of your maxscale user?
As well as the grants for your mysql user?
It is important to note that both users must have your MaxScale address listed as the host. Typical permissions should look like this: Maxscale User:
MariaDB/MySQL User:
Also, where is MaxScale installed? The warning about the loopback IP in your ticket is unusual. From your description, it appears you have MaxScale, MariaDB and Magento all running on the same machine. If that is the case, you'll have two services trying to listen on port 3306 for address 127.0.0.1 Can you please clarify and include your maxscale.cnf in your response? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nicolas Bigler [ 2019-05-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hi Here are the grants for the two users:
Maxscale is installed on the application server where magento is running and listens on port 3306 on 127.0.0.1 Here is the maxscale.cnf:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Todd Stoffel (Inactive) [ 2019-05-16 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
You are using a wildcard for your hostname in your GRANT statements. The wildcard is for normal TCP connections. However loopback (127.0.0.1) and localhost need to be explicitly set. In your MariaDB database, Add another entry for your user with @'127.0.0.1' and then restart your MaxScale process. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nicolas Bigler [ 2019-05-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I have added the GRANT entry for the localhost address:
and I have restarted the maxscale service.
I'm using this .my.cnf for the connection:
The log output of maxscale:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Todd Stoffel (Inactive) [ 2019-05-17 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I see the issue now, you are trying to SELECT from information_schema even though that user has no SELECT rights for that schema. The USAGE privilege may not be doing what you think it is. Read about the USAGE permission here: https://mariadb.com/kb/en/library/grant/#the-usage-privilege Change that GRANT to be:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Nicolas Bigler [ 2019-05-28 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the feedback. Therefore this issue can be closed. |