[MDEV-9786] Create user with require ssl throws syntax error Created: 2016-03-24 Updated: 2016-03-29 Resolved: 2016-03-24 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System |
| Affects Version/s: | 10.1.10 |
| Fix Version/s: | 10.2.0 |
| Type: | Bug | Priority: | Major |
| Reporter: | Jonas Krauss | Assignee: | Sergei Golubchik |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Ubuntu Server 12.04 LTS |
||
| Description |
|
On execution of this simple user creation statement CREATE USER 'repl'@'%.mydomain.com' IDENTIFIED BY 'blablabla' REQUIRE SSL; this error message is returned: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'REQUIRE SSL' at line 1 The same error message appears if the user is first created without the require constraint but then altered later like ALTER USER 'repl'@'%.mydomain.com' REQUIRE SSL; Thanks for any advice in advance. |
| Comments |
| Comment by Sergei Golubchik [ 2016-03-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
ALTER USER statement doesn't exists in 10.1, so the error you should've had in the second case must be "... syntax to use near USER", not "near REQUIRE". As for your first case, as far as I can see it should work. We have something similar in our test case:
and it is successfully run in our tests many times every day. There must be something special in your case that made it fail. Do you have any idea what that could possibly be? | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jonas Krauss [ 2016-03-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks for the quick reply. You are right on the ALTER USER statement, I was not aware this does not exist anymore in 10.1. I do not know of any special circumstances of our setup. Actually we have four MariaDB servers running on different machines, all on 10.1.8 and up. I just tried the same query on the other machines as well and it does not go through. I also tried your test query, same return:
The most recent installation was setup one week ago on Ubuntu Server 14 LTS, here is the version string: Server version: 10.1.12-MariaDB-1~trusty - mariadb.org binary distribution Here is SHOW CREATE TABLE mysql.user:
Let me know if I can pull more helpful information. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-03-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Sorry, that was my fault. Both CREATE USER ... REQUIRE SSL and ALTER USER were added only in 10.2, 10.1 does not support either command. In 10.1 you should use GRANT ... REQUIRE SSL statement. This is documented here: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Jonas Krauss [ 2016-03-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Thanks a lot Sergei, I should read the documentation more careful next time. In any case: for mysql they maintain a reference by version - I think this is a little easier than the current system used in the MariaDB knowledge base, which states the version in bold over each statement box (that is what I overlooked). Just an idea, I know resources are always limited and there are more important tasks. Keep up the great work! | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2016-03-29 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just a tip: in the knowledge base on the right panel, there often is a Product Versions block with checkboxes. See for example CREATE USER page. You check versions you're interested in and unsupported parts of the manual will be grayed out. |