Comments - Cannot create user account

6 years, 12 months ago Daniel Bartholomew

That query should work if you're logged in as the MariaDB root user.

To debug I would first check to make sure you are logged in as root with:

SELECT USER(),CURRENT_USER();

The output should be something like the following:

MariaDB [(none)]> SELECT USER(),CURRENT_USER();
+----------------+----------------+
| USER()         | CURRENT_USER() |
+----------------+----------------+
| root@localhost | root@localhost |
+----------------+----------------+
1 row in set (0.01 sec)

MariaDB [(none)]>

Then issue a SHOW GRANTS to check what your logged-in user's permissions are.

The root user should have permissions similar to the following:

MariaDB [(none)]> SHOW GRANTS;
+---------------------------------------------------------------------+
| Grants for root@localhost                                           |
+---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION       |
+---------------------------------------------------------------------+
2 rows in set (0.00 sec)

MariaDB [(none)]>
 
6 years, 12 months ago Mike Brown

All the same, except that IDENTIFIED BY PASSWORD .. was also output.

 
6 years, 12 months ago Daniel Bartholomew

Then I would check if the user is already created:

SELECT Host,User FROM mysql.user;
 
6 years, 12 months ago Mike Brown

Well, guess what, I exist. And I shouldn't exist. MariaDB was installed and configured when I installed Fedora 23. I finally got a chance to play with it. So, I tried logging in a root, but I had no idea what the root password was. After a lot of back and forth trying this and that, I finally found the instructions on how to reset the root password. During all of the stuff trying to get root reset, I must have created my account. I just do not remember doing it.

Thanks for responding, sorry to have bothered you.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.