Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 382  / 2 Years ago, wed, july 20, 2022, 2:38:06

I am planning to change my /etc/mysql/my.cnf file in Nano. I have 2 questions about this:




  1. Before I do this, is there a way to make a backup of this file?


  2. If something goes wrong, how can I restore the file from the backup (from question 1.)?



More From » backup

 Answers
5

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


then:



sudo nano /etc/mysql/my.cnf


To restore:



sudo rm /etc/mysql/my.cnf
sudo mv /etc/mysql/my.cnf.bak /etc/mysql/my.cnf

[#14679] Friday, July 22, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ingsta

Total Points: 391
Total Questions: 103
Total Answers: 124

Location: Bonaire
Member since Wed, Mar 29, 2023
1 Year ago
;