Home  >  Article  >  Backend Development  >  How to set database path in php

How to set database path in php

藏色散人
藏色散人Original
2020-11-06 09:12:462860browse

How to set the database path in php: first stop the MySQL service; then check the default installation location of mysql; then find the my.ini file and modify the value of datadir; finally start the MySQL service.

How to set database path in php

Recommended: "PHP Video Tutorial"

PHP settings MYSQL data path:

First, stop the MySQL service.

Start--Run--services.msc--Find the MySql service and stop

Default installation location of mysql:

C:\Program Files\MySQL\MySQL Server 5.0

Then, modify the my.ini file.

Enter the MySQL installation directory, find my.ini, and modify the value of datadir.

#Path to the database root www.2cto.com
datadir="D:/Program Files/MySQL/MySQL Server 5.0/Data/" -- 修改这个值即可

Finally, start the MySQL service.

Start--Run--services.msc--Find the MySql service and start it.

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