简体   繁体   中英

How can I add an entry to an existing my.ini file for a mysql service with the command line?

Is it possible to append an existing my.ini with a new configuration via the command line. I need to add the line 'event_scheduler=ON' to the my.ini file during an install. I will have the root password if the is necessary. I thought I might be able to use the mysql command line app to manipulate the .ini file, but haven't been able to find anything about how to do it.

As long as you have privileges to edit the ini file, you can do this using any text editor (try nano if you know nothing about non-GUI text editors). If you just want to append a single line, you could also do echo "text to append" >> my.ini which will append the specified text on its own line.

(caution: using > instead of >> will overwrite the file instead...).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM