Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After several years of using MySQL, I've encountered some security issue that quite baffle me.

I create a new database, and a new user, then grant CRUD rights only to the new DB, to this user.

But when I log in either via some MySQL client, or via CLI mysql, I can read and change data in all databases.

I double-checked myself and verified that I should have access only to single DB - still I can access every DB.

Is there any setting for MySQL that just cause it to ignore the security, and I have accidentally turned it on?

Thanks.

share|improve this question
    
what does show grants 'user'@'localhost' show? –  cpbills Jul 10 '11 at 2:31

3 Answers 3

Yes; if you start MySQL with --skip-grant-tables it allows free and easy access to everything by everyone. However, it's far more likely that you've made a mess of your auth and perms (it's really easy to do); post (probably in a new question is best) the set of queries/GRANT statements that have caused the problems (test on a scratch server that they actually do cause the problems you think they do) and someone can explain what's gone wrong.

share|improve this answer

i don't suppose you did grant create,update,read,delete on *.* to 'user'@'localhost'; ?

also check to make sure you're not using implicit user/password from a ~/.my.cnf file, and are starting the mysql CLI with mysql -u user -p (i mean, you may be 'logging in' as root@localhost or something...)

show grants; should show all the permissions you have, and which 'user' you are.

share|improve this answer
up vote 0 down vote accepted

After restart it went away - strange stuff, will keep monitoring.

Thanks to everyone who answered.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.