Is it possible to make changes in mysql’s my.ini file using PHP script?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure – it’s just a text file.
However, you would have to locate the correct INI file, stop the mySQL service, make the change, and start the service again. That’s going to be tough. Your PHP script would probably need root privileges to stop and restart the service, and a PHP script should never have root privileges.
Update: A combination of these should work:
PHP commands to change the file: (enter http://www.php.net/commandname to be redirected to the manual)
fopen()fwritefclosePHP command to execute an external command:
exec()Windows commands to stop and restart a service:
net stop/net startAs to how to locate the my.ini programmatically, I have no idea. If you can, set that manually.