Recipe 1.5. Protecting Option Files from Other Users


Problem

Your MySQL username and password are stored in your option file, and you don't want other users to be able to read that file.

Solution

Set the file's mode to make it accessible only by you.

Discussion

On a multiple-user operating system such as Unix, you should protect your option file to prevent other users from reading it and finding out how to connect to MySQL using your account. Use chmod to make the file private by setting its mode to enable access only by yourself. Either of the following commands do this:

% chmod 600 .my.cnf % chmod go-rwx .my.cnf             

On Windows, you can use Windows Explorer to set file permissions.




MySQL Cookbook
MySQL Cookbook
ISBN: 059652708X
EAN: 2147483647
Year: 2004
Pages: 375
Authors: Paul DuBois

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net