My username and password to access mysql database is currently located in a config file at the root level. I include the config file whenever I need access. Doesn't seem safe to me.
What can I do to protect the username and password? Thanks.
My username and password to access mysql database is currently located in a config file at the root level. I include the config file whenever I need access. Doesn't seem safe to me.
What can I do to protect the username and password? Thanks.
That password has to be stored somewhere in order for it to work. Even if you encrypted that password and someone accessed your config file they could login with that encrypted password. You can do following 4 things to start with.
root
create a new username and assign only the required database permissions to it. Do not save your root
password in your configlocalhost
, do not allow remote accessHowever, none of these guarantee foolproof security, they just make it harder for someone to get there