LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-30-2016, 10:09 PM   #1
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 409

Rep: Reputation: 32
mariadb mysql Compatibility issue GRANT ALL ON database.* TO 'user';


mysql -p
create database aleX;
Query OK, 1 row affected (0.00 sec)
create USER 'aleX'@'localhost';
Query OK, 0 rows affected (0.00 sec)
SET PASSWORD FOR 'aleX'@'localhost' = PASSWORD('7!d6b4c40cd');
Query OK, 0 rows affected (0.00 sec)
GRANT ALL ON aleX.* TO 'aleX';
ERROR 1133 (28000): Can't find any matching row in the user table

GRANT ALL ON aleX.* TO 'aleX'; worked just fine on mysql
 
Old 01-30-2016, 10:23 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by enyawix View Post
mysql -p
create database aleX;
Query OK, 1 row affected (0.00 sec)
create USER 'aleX'@'localhost';
Query OK, 0 rows affected (0.00 sec)
SET PASSWORD FOR 'aleX'@'localhost' = PASSWORD('7!d6b4c40cd');
Query OK, 0 rows affected (0.00 sec)
GRANT ALL ON aleX.* TO 'aleX';
ERROR 1133 (28000): Can't find any matching row in the user table

GRANT ALL ON aleX.* TO 'aleX'; worked just fine on mysql
aleX@localhost is not the same user as aleX.

GRANT ALL ON aleX.* TO 'aleX'@'localhost' should work.

This works the same on MySQL and MariaDB.

If it worked this way, exactly as you have shown, on MySQL, then there would have been a non-localhost user of the same name in the users table.
 
1 members found this post helpful.
Old 01-30-2016, 10:29 PM   #3
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 409

Original Poster
Rep: Reputation: 32
Found a working syntax

GRANT ALL on aleX.* to 'aleX'@'localhost';
Query OK, 0 rows affected (0.00 sec)

I hope switching will not break CMS systems designed to run on LAMP.
 
Old 01-30-2016, 10:46 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by enyawix View Post
Found a working syntax

GRANT ALL on aleX.* to 'aleX'@'localhost';
Query OK, 0 rows affected (0.00 sec)

I hope switching will not break CMS systems designed to run on LAMP.
Well, as noted above, there is no difference in this between MySQL and MariaDB. So if it works with 'aleX' on one but not the other, that is only because one has a MySQL 'aleX' user and the other does not.

Remember, the MySQL/MariaDB user names have nothing to do with system users of the same name. And 'username' is not the same user as 'username@localhost'.

Good luck!

Last edited by astrogeek; 01-30-2016 at 10:47 PM. Reason: typos
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Grant permission to user on MySQL tranphat Linux - Security 2 03-12-2014 11:17 PM
[SOLVED] MySQL: Can't GRANT privileges after restoring a database Chili.Willy Linux - Software 2 12-03-2009 09:21 PM
MySQL remove grant priv's from a drop user? helptonewbie Linux - Newbie 6 01-24-2008 11:05 AM
MySQL: Grant user database creation rights Swakoo Linux - General 4 09-13-2006 06:34 AM
Mysql User grant problems ubers0ldat Linux - Software 7 07-30-2003 12:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration