I am planning to change my
/etc/mysql/my.cnf file in Nano. I have 2 questions about this:
Before I do this, is there a way to make a backup of this file?
If something goes wrong, how can I restore the file from the backup (from question 1.)?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
It should be as simple as making a copy of the file. Then, if something goes wrong, you can just delete your modified file and rename the copy.
I would do:
sudo cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
sudo nano /etc/mysql/my.cnf
sudo rm /etc/mysql/my.cnf sudo mv /etc/mysql/my.cnf.bak /etc/mysql/my.cnf