1

I was attempting to recover some diskspace as described here:

How to shrink/purge ibdata1 file in MySQL

I did a mysqldump for all databases.

Then I dumped all the databases and unfortunately I was a bit fast and deleted the database named "mysql" too.

Now I can not reconnect to the server, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' "

I suppose I have deleted account info etc?

So what are my options? Re-Install MySQL and import the dump?

The MySQL accounts I had where simple so I can easily re-create them.

Community
  • 1
  • 1

1 Answers1

2

If you have a dump of all databases, there's no real problem.

Simply issue

mysql_install_db

on the command line, and a new mysql schema will be created. Re-create your accounts, as you suggested, and afterwards import your dump.

Dan Soap
  • 10,114
  • 1
  • 40
  • 49
  • 1
    Phew! I reconfigured a new root password with "sudo dpkg-reconfigure mysql-server-5.1". It re-created the mysql database and I could log in as root, start recovering the dump. Now I should be OK. Thanks Cassy! – Jan Fredriksson Jan 04 '12 at 02:35