Home  >  Article  >  PHP Framework  >  How to configure the database in thinkphp5

How to configure the database in thinkphp5

爱喝马黛茶的安东尼
爱喝马黛茶的安东尼Original
2019-08-26 11:28:143648browse

How to configure the database in thinkphp5

First find the configuration file, in application->config.php.

How to configure the database in thinkphp5

After finding the configuration file, open the configuration file.

How to configure the database in thinkphp5

Related recommendations: "ThinkPHP Tutorial"

Set the namespace and debugging mode.

How to configure the database in thinkphp5

Set the type of database.

How to configure the database in thinkphp5

Set the host address. If you are developing locally, write 127.0.0.1.

How to configure the database in thinkphp5

Set the name of the database, which is which database you want to use.

How to configure the database in thinkphp5

The next step is to set the username and password for the database.

How to configure the database in thinkphp5

How to configure the database in thinkphp5

The above is the detailed content of How to configure the database in thinkphp5. 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