[MXS-46] mysql shell client can't connect to maxscale Created: 2015-03-16 Updated: 2015-06-17 Resolved: 2015-06-17 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Core |
| Affects Version/s: | 1.0.5 |
| Fix Version/s: | 1.1.0 |
| Type: | Bug | Priority: | Minor |
| Reporter: | André Bauer | Assignee: | Massimiliano Pinto (Inactive) |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu 14.04 |
||
| Description |
|
I just moved from haproxy to maxscale in front of a 3 node mariadb 10.0.17 galera cluster. mysql -utestuser -ppassword -h mysql.local.net mydatabase -e "show tables;" ERROR 1045 (28000): Access denied for user 'root'@'192.168.111.31' (using password: YES) to database 'mydatabase' when i connect to one of the mariadb servers directly it works: mysql -utestuser -ppassword -h mysql1.local.net mydatabase -e "show tables;" --------------------------
--------------------------
-------------------------- Whats the problem here? In skygw_msg1.log i also found some entries like: "2015-03-16 15:09:01 Galera Service: login attempt for user testuser, user not found." |
| Comments |
| Comment by Dipti Joshi (Inactive) [ 2015-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
@André Bauer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for th tip. Will try it.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by markus makela [ 2015-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The error message about the root user seems to suggest that it's trying to use the root user. MaxScale by default doesn't allow root user but this can be enabled by adding 'enable_root_user=1' to the service configuration. Also adding the 'localhost_match_wildcard_host=1' should help if some of the host names resolve to localhost. If this is not the case and adding the root user fails, if possible, please provide the error logs for that attempt. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-16 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I also have this problem with non root users... markus makela (JIRA) <jira@mariadb.atlassian.net> schrieb am Mo., 16. März | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I tried the "enable_root_user=1" and "localhost_match_wildcard_host=1" options but still have this problem, even for non root users. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
we suggest to issue this command via maxadmin client or telnet interface: MaxScale> show dbusers Galera\ Service this will print the users@hosts loaded from backend and will help us understand your authentication issues example: MaxScale> show dbusers My_Service | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
/usr/local/skysql/maxscale/bin/maxadmin -pskysql show dbusers Galera\ Service: Users table data I hope it ok to hide the usernames... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I just found: https://github.com/mariadb-corporation/MaxScale/wiki/Install-troubleshooting | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I understand you don't want to share tat informations. Could you please check if your 'testuser' or 'root' is loaded with % or 127.0.0.1 or anther IP? If you are connecting to a remote IP you need root@IP or root@% You can also try testing the mysql connection without db name, just to understand whether the issue is db name. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I've found 2 root users in "User names": "root@%" and "root@127.0.0.1" Before it worked without db name and did not work with db name for the root user. Thanks for your help! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
xyz@127.0.0.1 is required for connecting client to maxscale using socket or 127.0.0.1 Depending on your backend mysql.user content it may be also required 'localhost_match_wildcard_host=1 enable_root_user=1 is of course required if you want to load root user. Could please that summarise whether you have another issue? We may then try to understand remainig issue or just close the ticket. Thanks for evaluating MaxScale | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Seems to work now. "2015-03-17 16:37:20 Galera Service: login attempt for user foo_bar, user not found." But the user exists. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Is the 'foo_bar' user listed in show dbusers Galera\ Service ? Does it have % and 127.0.0.1, or naother Ip set? Are you connecting with db name or without it? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Yes, its listed as "foo_bar@%" and has only select rights on "foo.my_table". What works is: What not works: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It seems an issue with db grants for foo_bar. Please try mysql -ufoo_bar -ppass -h mysql.local -D foo -e "select 1" mysql -ufoo_bar -ppass -h mysql.local -D foo (just to check if you have the mysql prompt) and then issue SELECT 1 Another check is from mysql.db database, just check the 'foo_bar' user has the grant on db 'foo' Currently MaxScale supports only grants for all or specific db and not for a table in a db. The all db grants is checked from mysql.user: select_priv = Y or N Query example for the specific db grants check for user 'foo_bar': MySQL> select user,host,db from mysql.db where user='foo_bar'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by André Bauer [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
mysql -ufoo_bar -ppass -h mysql.local -D foo -e "select 1": mysql -ufoo_bar -ppass -h mysql.local -D foo: mysql -ufoo_bar -ppass -h mysql.local: No, the user foo_bar did not had grant on foo. Thanks again! Will this behaviour change in the future? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Massimiliano Pinto (Inactive) [ 2015-03-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
If dbname is set at connection time it will be checked before letting the user get in. a change we have in mind, for a near future, is that MaxScale will support the dbname auth with at least the table grant, as other users suggested. The idea is that MaxScale has the same behavior of mysql backend db: if the user cannot access the db at connect time the same will happen when connecting to MaxScale. Feel free to start a discussion in maxscale@googlegroups.com about that, if you think the current implementation is too demanding for your current setup. We can close the ticket for now I guess. Thanks for all your tests and the time spent here. Massimiliano | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Dipti Joshi (Inactive) [ 2015-06-17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Works as designed as noted in Massmiliano's comment |