使用加密密码连接PDO? [英] PDO Connect with an encrypted password?

查看:63
本文介绍了使用加密密码连接PDO?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

理想情况下,我不希望在配置文件中没有原始格式的数据库密码.

Ideally I would prefer not to have a password for a database in its raw form in a config file.

pdo mysql connect是否接受md5或sha1版本?

Is there away that pdo mysql connect accepts a md5 or sha1 version??

谢谢

推荐答案

1)使文件只能由www-data访问.

1) make the file only accessible to www-data.

2)永远不要使用权限超过所需权限的用户名/密码组合(例如,不授予,删除,创建等,仅选择插入)

2) never use a username/pw combo that has more privelage than needed (eg no grant, drop, create etc, only select insert)

3)使mysql只接受来自127.0.0.1的连接

3) make mysql only accept connections from 127.0.0.1

如果某人可以访问您的邮箱,那么您所担心的不仅仅是担心应用程序的数据库密码.

If someone has access to your box you have more problems than worrying about your applications db password.

这篇关于使用加密密码连接PDO?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆