The Biggest MySQL mistake I made
The Biggest MySQL mistake I made
Ok, as usual I have broken my promise to keep writing post. Anyways, there is a good news too. I have been studyingGolang
for months now and developing some my own projects.But today I am going to share completly different thing I met recently.
I was working with a MySQL table and wanted to delete a record from it. So I wrote
delete from my_table..
before I put where
clause accidentally I hit enter.So my terminal was like
mysql> delete from my_table
->
what I did was, just put ;
and press enter.mysql> delete from my_table
-> ;
Query OK, 56 rows affected (0.09 sec)
Boom, I have deleted all the records from my table. I had spent another hour plus to manually insert all the records back to table. Luckily I have printed all the records in that table.SO the lession I learn that day was, never use
;
in unknown MySQL queries. If you make a mistake and came ->
line, just hit CTRL+c
, it will terminate the current query and bring a new line.I hope you wont make the mistake I made.
Happy Coding!
Comments
Post a Comment