NEWS CATEGORIES:



NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
Home / News / Webmaster / Tips and Tricks

Tips and Tricks


How to Secure Your Password for MySQL

Keep your passwords secure

By Adrian Placinta, Web News Editor

24th of September 2007, 14:11 GMT

Adjust text size:



Enlarge picture
The first way to keep your password secure is to secure the user grant table and never give access to it to users that aren't in the administrative group. Another way to secure your password is to prevent running programs that connect to your SQL server and users can see the password
through that program.

To prevent that, use the following options: -pyour_pass or --password=your_pass . So, your sql statement will look like this: shell> mysql -u root -ppass db_name. You may use this statement because it is very easy to remember, but is relatively insecure. Users can see the password if they have access to system status programs. Almost all MySQL clients overwrite the command-line password argument with zeros during their initialization sequence, but there is a fraction of second when the password is visible.

A solution for this is to use the following statement: shell>mysql -u root -p db_name. This way you will be asked to enter separately the password and the characters from the password will be changed with "*" so nobody can decipher your password. The problem with this method is that it is suitable with interactive programs. If you want to invoke a program from a non-interactive script, there is no way to enter the password.

Another way to keep your password secure is to enter the my.cnf file. You will have to enter it in [client] section of the file:
[client]
password=your_password

In Unix environment chmod is the file to access mode 400 or 600.

The last method you can use is to store your password in the MYSQL_PWD environment variable. But this method is the most insecure one. Again, users that have access to system status programs can see the password.

After presenting the methods, I recommend you to use the configuration file. This is the most secure way to hide your password.

TAGS:

MySQL | password | chmod
Read by 1,450 user(s) | Add comment | Link to this article TWEET THIS


Article rating:
Fair (2.0/5) 7 vote(s)    

Subscribe to news | Print article | Send to friend

© Copyright 2001-2009 Softpedia
Contact:

 

 

SEARCH THE NEWS ARCHIVE :




Today's News
| Yesterday's News | News Archive


MORE RELATED ARTICLES:


MySQL Query Browser

MySQL Migration Toolkit

Install Multiple MySQL Services

How to Copy an MYSQL Database from One Computer to Another

Could Login Passwords Be Cracked?

How to Install phpMyAdmin on Windows

How to Limit Account Resources in MySQL

How to Check MySQL Tables for Upgrade

User opinions:

No user comments yet.
Be the first to express your opinion using the form below!

Share your opinion:

Your Name:
Your Email Address:
(will not be used for commercial purposes)
Solve this to prove you're not a bot: =
Your review/opinion:

 




Windows tabGames tabDrivers tabMac tabLinux tabScripts tabMobile tabHandheld tabGadgets tabNews tab

SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   ENTER NEWS SITE   |   ENGLISH BOARD   |   ROMANIAN FORUM