Home>Article>Backend Development> In which file is the php database password located?

In which file is the php database password located?

(*-*)浩
(*-*)浩 Original
2019-09-29 09:08:08 7514browse

The username and password of the database in PHP are generally written in a configuration file and placed in the root directory of the website, or in the include folder. Usually the file name is config.inc.php.

In which file is the php database password located?

Now almost all open source CMS and website systems, PHP type, database passwords are written in files similar to config.inc.php middle.You can watch (DEDECMS/phpcms/DISCUZ/thinkphp, etc.)

config.inc.php(Recommended learning:PHP video tutorial)

'localhost', 'port'=>'3306', 'db' =>'localhost', 'db_user' =>'root', 'db_psw' =>'', 'db_name' =>'test' ); $connID=@mysqli_connect($config['host'],$config['db_user'],$config['db_psw'],$config['db_name'],$config['port']); if(!$connID){ echo("数据库连接失败"); } ?>

Even if the user name and password of the MYSQL database are known to others and there is no remote connection permission, it is useless.

Unless you write the super administrator user permissions in the PHP file (generally only given to ordinary users with read and write permissions)

The rented space is separated using the virtual host management system. The permission distribution among N stations on a server is different and will not affect each other (if it does, it is because the administrator of this IDC service provider is too unqualified and basically does not do it).

Unless the entire server is taken down, in this case, the result will be the same no matter where you write it.

No matter where it is written, it is transparent to the IDC service provider administrator. If you want to see it, you can read it, and if you want to delete it, delete it, but generally do not touch it. This involves professional ethics and company reputation.

I used to manage a website for five years, with nearly 100,000 IP addresses every day, and there was no security issue due to the leakage of MYSQL user names and passwords.

The last point is also the most direct point: millions of webmasters, as long as they use PHP, are doing this, and few of them worry about this problem.

The above is the detailed content of In which file is the php database password located?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn