Home > Backend Development > PHP Problem > How to set database path in php

How to set database path in php

藏色散人
Release: 2023-03-07 11:56:01
Original
2893 people have browsed it

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
Copy after login

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/" -- 修改这个值即可
Copy after login

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!

Related labels:
php
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