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.
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!