Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi All,
I've dropped some users and database 'test' created on normal install of MySQL server 5.0.x
However as it says in the mysql doc that the grant priv's are not automatically removed is the best way to remove those priv's using the 'delete' syntax??
DELETE FROM mysql.db WHERE Db = 'test';
Is that the correct MySQL method, it doesn't seem overly clear if that is correct in the MySQL doc?
Yes but couldn't revoke these permissions as in a:-
select * from mysql.db;
i can see the tables test and test\_%, automatically created tables by MySQL with no users associated to them, in which case i couldn't remove it even though there wasn't a database called test anymore as i drop'd it. I've now used 'delete' to remove those from the table as its not something i need to use. Therefore not allowing anonymous users, and already default tables to be on the server.
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Once you have dropped the test data base, you're done; however, if you want to get rid of the rest of it:
Code:
mysql mysql
drop database if exists test;
delete from db where db = 'test';
delete from db where db = 'test\\\%';
^D
will do that for you.
While you're digging around in there, put a password on the root user (the MySQL root user, not the system root) if you haven't already done that; then the syntax will be
Code:
mysql --password=password mysql
or
mysql -p mysql
password: <enter it>
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
Bye the by... you may want to consider getting out of the habit of "...mysql.db..."
When you start MySQL, you can start "empty" or start with the name of the data base you want to use; e.g., an "empty" start is
Code:
mysql
and a "named" start is
Code:
mysql dbname
If you start empty, you select a data base to work with
Code:
mysql
> use dbname;
And, the less fiddling around you do with the mysql data base, the better (you can really mess things up if you manage to do something silly in that data base if you know what I mean -- been there, did that, don't wanna do dat again...).
Cheers, Totally noted and i've been there for other purposes with different things before. It is the way to learn, break it fix it don't do it again :-)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.