I accidently dropped the mysql db

Today, i was absent minded and instead of droping the databases i wanted I wrote

drop database mysql;

What do i do now!?! i didnt do anything else since and i havent closed my session.

Luckily this is just my local computer with no real data. Should i delete mysql data folder? can i undo it? is there a cmd i can do to fix it? is there no real problem and i am freaking out for nothing?

-edit- ok so it WAS my server. Lucky its MY server and not the company server. I only have sites no one visits anyways. Since it was the server, i had twice a day dumps of sites that does rarely changes. I tried using my dump script to dump the db but it got an error. I figure its ok and hasnt been touched in days so i tried to restore it with this

gunzip < mybackup.sql.gz | mysql

I got the error

ERROR 1146 (42S02) at line 12: Table 'mysql.time_zone_name' doesn't exist

Now that i cant restore, what do i do?


Solution 1:

The solution you want (and this should work) is to run mysql_install_db as root. or dpkg-reconfigure mysql if you're a deb/ubu user.

Manpage description:

mysql_install_db initializes the MySQL data directory and creates the system tables that it contains, if they do not exist.