Home > Backend Development > PHP Problem > How to set up the database in php source code

How to set up the database in php source code

angryTom
Release: 2023-02-28 09:46:02
Original
3042 people have browsed it

How to set up the database in php source code

php source code how to set up the database

php source code to modify the database setting method: first find the program in the source code configuration file; then open it with a text editor; then modify the database address, database name, user name, connection password, database prefix and other parameters; and finally save it. Here we take the Dreamweaver program as an example to demonstrate the modification method.

Find the path where the dede database configuration file is located: /data/common.inc.php

Open it for editing with Notepad.

The following is the content of the dede database configuration file:

<?php //数据库连接信息  
$cfg_dbhost = &#39;localhost&#39;;  //网站地址
$cfg_dbname = &#39;data&#39;;  //数据库名
$cfg_dbuser = &#39;data_user&#39;;  //数据库用户名
$cfg_dbpwd = &#39;admin&#39;;  //数据库连接密码
$cfg_dbprefix = &#39;dede_&#39;;   //数据库前缀
$cfg_db_language = &#39;gbk&#39;;  //数据库语言版本
?>
Copy after login

Just change the above variables to the data you need. Don't forget to save at the end.

For more PHP related knowledge, please visit PHP Chinese website!

The above is the detailed content of How to set up the database in php source code. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template