Strange behaviour when creating a new user

Alles, was MariaDB und MySQL betrifft, kann hier besprochen werden.

Strange behaviour when creating a new user

Postby otalado » 08. May 2022 05:44

I logged to MariaDb:
mysql -u root

Then I issued following commands:
USE mysql;
CREATE USER 'xxx'@'192.168.1.%' IDENTIFIED BY 'xyz';
GRANT ALL PRIVILEGES ON *.* TO 'xxx'@'192.168.1.%' WITH GRANT OPTION;

The last command triggered an error:

MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'xxx'@'192.168.1.%' WITH GRANT OPTION;
ERROR 1133 (28000): Can't find any matching row in the user table


However, when I tried the same thing using the HeidiSQL:

USE mysql;
CREATE USER 'xxx'@'192.168.1.%' IDENTIFIED BY 'xyz';
GRANT ALL PRIVILEGES ON *.* TO 'xxx'@'192.168.1.%' WITH GRANT OPTION;
FLUSH PRIVILEGES;


the user was created without any errors.

So, I was able to create the user, but I would still like to understand why it did not work from the command line.
otalado
 
Posts: 2
Joined: 17. April 2022 05:55
XAMPP version: 8.12
Operating System: windows 10 pro x64

Re: Strange behaviour when creating a new user

Postby Altrea » 08. May 2022 08:44

Sorry, i cannot reproduce your issue.

Code: Select all
MariaDB [(none)]> use mysql;
Database changed
MariaDB [mysql]> CREATE USER 'xxx'@'192.168.1.%' IDENTIFIED BY 'xyz';
Query OK, 0 rows affected (0.011 sec)

MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO 'xxx'@'192.168.1.%' WITH GRANT OPTION;
Query OK, 0 rows affected (0.011 sec)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11555
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64

Re: Strange behaviour when creating a new user

Postby Nobbie » 08. May 2022 08:52

I think you have a typo somewhere in your SQL, did you copy and paste it from the terminal to the forum?
Nobbie
 
Posts: 12415
Joined: 09. March 2008 13:04


Return to MariaDB - MySQL

Who is online

Users browsing this forum: No registered users and 7 guests