LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 11:09 PM   #1
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 399

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, 11:23 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,515
Blog Entries: 6

Rep: Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426
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, 11:29 PM   #3
enyawix
Member
 
Registered: Sep 2003
Location: ky
Distribution: gentoo
Posts: 399

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, 11:46 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,515
Blog Entries: 6

Rep: Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426Reputation: 2426
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 11:47 PM. Reason: typos
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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-13-2014 12:17 AM
[SOLVED] MySQL: Can't GRANT privileges after restoring a database Chili.Willy Linux - Software 2 12-03-2009 10:21 PM
MySQL remove grant priv's from a drop user? helptonewbie Linux - Newbie 6 01-24-2008 12:05 PM
MySQL: Grant user database creation rights Swakoo Linux - General 4 09-13-2006 07:34 AM
Mysql User grant problems ubers0ldat Linux - Software 7 07-30-2003 01:33 AM

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

All times are GMT -5. The time now is 04:45 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration