Home > Net >  I have written a line in nano /etc/my.cnf file and how I'm not able to remove it
I have written a line in nano /etc/my.cnf file and how I'm not able to remove it

Time:09-29

I have added secure-file-priv = "" to my nano /etc/my.cnf file for mysql and now I'm not able to remove it.When I remove that line and try to save it, it's asking me to write to a file and the changes are not saved

I tried to uninstall and install mySQL but due to this the server is not able to start.

Error Messages:
my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.
my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
Starting MySQL
.my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.
my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!
my_print_defaults: [ERROR] Found option without preceding group in config file /etc/my.cnf at line 1.
my_print_defaults: [ERROR] Fatal error in defaults handling. Program aborted!

Is there any way I can fix this error, I tried a lot but couldn't find any solution

CodePudding user response:

"errors when saving" are often linked to access rights issues.

  • run ls -l /etc/my.cnf to confirm that this file is owned by root.

  • in the vast majority of cases, system wide configuration files are owned by root. To edit a root file, you should do it with root privileges, e.g :

sudo nano /etc/my.cnf

(that's probably how you were able to add the config parameter in the first place)

  • Related