Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Jul 04, 2013 2:07 am 
Offline
Senior Member

Joined: Sun Mar 28, 2010 2:43 pm
Posts: 76
Website: http://tomakefast.com
Location: Texas
A while back I either renamed/replaced the "root" MySQL user with my username, in the name of extra security. Now I can't grant myself access to anything. I just have one user which doesn't have permission to "grant" access to the "mysql" database. So how can I edit users if I can't get into the "mysql" database?

To make matters worse, the only way I can get into the database through localhost is with "/usr/bin/mysqld_safe --skip-grant-tables&" BUT the catch is with "--skip-grant-tables" I can't use the grant command.

Fortunately it's not a catastrophic problem because my application has all the permission it needs to run the website. But I need to get this fixed because sooner or later I'll need full access.

This doesn't work either:

Code:
mysql> create user root@localhost IDENTIFIED BY 'blah';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement


Any ideas?

_________________
PHP Development @ Tomakefast


Last edited by ferodynamics on Thu Jul 04, 2013 4:20 am, edited 1 time in total.

Top
   
PostPosted: Thu Jul 04, 2013 2:51 am 
Offline
Senior Member

Joined: Sun Mar 28, 2010 2:43 pm
Posts: 76
Website: http://tomakefast.com
Location: Texas
I'm making some progress. This worked:

Code:
UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='me';


Now I can access the "mysql" table and I created a "root" user but I'm not sure I have full access yet.

Code:
grant all on *.* to root@localhost with grant option;
Query OK, 0 rows affected (0.12 sec)


I keep ketting 0 rows affected. Is that because these users already have full privileges?

_________________
PHP Development @ Tomakefast


Top
   
PostPosted: Thu Jul 04, 2013 4:13 am 
Offline
Senior Member

Joined: Sun Mar 28, 2010 2:43 pm
Posts: 76
Website: http://tomakefast.com
Location: Texas
Looks like I'm good to go now.

http://stackoverflow.com/questions/1746 ... 7#17465047

Basically you can check with "show grants;" and "select * from user;" if you have full privileges.

_________________
PHP Development @ Tomakefast


Top
   
PostPosted: Thu Jul 04, 2013 11:14 am 
Offline
Senior Member
User avatar

Joined: Thu Jun 16, 2011 8:24 am
Posts: 412
Location: Cyberspace
root@localhost should already have full privileges on all tables, and should already have a password. You should need only grant privileges to non-root users, and set a password ("identified by" part) for users which don't already have a password.

_________________
Kris the Piki Geeker


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group