0

When I run the following command:

SELECT user, host, password, plugin FROM mysql.user WHERE user='user_123';

this is what I get:

+----------+---------------------------------------+-------------------------------------------+-----------------------+
| user     | host                                  | password                                  | plugin                |
+----------+---------------------------------------+-------------------------------------------+-----------------------+
| user_123 | IPv4-address-1                        | *775F9B443B3F45EC0042CE69872E7CF2D20D7FB4 | mysql_native_password |
| user_123 | IPv4-address-2                        | *775F9B443B3F45EC0042CE69872E7CF2D20D7FB4 | mysql_native_password |
<snip>
| user_123 | domain-1                              | *775F9B443B3F45EC0042CE69872E7CF2D20D7FB4 | mysql_native_password |
| user_123 | domain-2                              | *775F9B443B3F45EC0042CE69872E7CF2D20D7FB4 | mysql_native_password |
<snip>
| user_123 | %                                     | *775F9B443B3F45EC0042CE69872E7CF2D20D7FB4 | mysql_native_password |
| user_123 | *                                     | *775F9B443B3F45EC0042CE69872E7CF2D20D7FB4 | mysql_native_password |
+----------+---------------------------------------+-------------------------------------------+-----------------------+

Q) I know that % stands for the wildcard, but what is the difference between % and *?

1 Answer 1

3

Per create user % has a wildcard meaning. _ also matches a single character like the like expression.

* has no meaning and was probably put there by someone not familiar with what they are doing. Recommend dropping this use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.