MySQL : A little security tip

>In this article I am going to show you a little trick about MySQL ,which might help you to prevent some attack on production database server.Every MySQL server has a root user attached to it and for intruders it’s very easy to guess that and launch attack on it.

Here is how you can change the root user name for that MySQL server :


bhaskar@bhaskar-laptop_08:55:51_Thu Jan 13:~> sudo mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 26
Server version: 5.1.51-log Gentoo Linux mysql-5.1.51

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>use mysql;
mysql> update user set password=PASSWORD("NEWPASSWORD") where
User='';
mysql> flush privileges;
mysql> quit

That’s all!!

Hope this will help.

Cheers!
Bhaskar

About unixbhaskar
GNU/Linux Consultant

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: