Recreate the mysql Database

From Hashmysql
Jump to: navigation, search

I've dropped the entire mysql database, which holds all the privileges I need to login.

  • Stop mysqld and restart it with the --skip-grant-tables --user=root options (Windows users omit the --user=root portion).
  • Recreate the mysql database. If you have a backup, use that. Otherwise, issue CREATE DATABASE mysql; and then run the SQL file below that is appropriate for your version:
  • Stop mysqld and restart it as normal. You should now be able to login as root with a blank password.