Global Parameters

From NazimWIKI
Jump to navigation Jump to search

New to MySQL, but will make notes for my benefit, and for the odd person who stumbles on this post via Google. I need to write a few cron scripts for a MySQL database and I don't think I should put the connect string in them for the world to see.

A reasonable solution found is to simply store the password in the /etc/my.cnf (options) file.


Added the following text to achieve this. Also decided to store the default database name as well to make life simpler.


[client]
 password={password}
 database={dbname}


For this setting to take affect, just had to restart the database. So now the cron script can simply connect to the correct database by typing in "mysql".

Need to assess security implications of this decision as I proceed to learn the nuances of MySQL.