LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to recreate mysql database (https://www.linuxquestions.org/questions/linux-software-2/how-to-recreate-mysql-database-26563/)

java8964 07-25-2002 09:13 PM

how to recreate mysql database
 
Hi, My linux version is Suse 8.0. Today, I tried to load a sql script into mysql database. But I forget to change to the right db. So the script is loaded into mysql database. Even worse is that the scirpt has table named 'user', so it drop and recreate this table. Now in mysql database, I mass up with the whole database. I can't login as admin or any account now.

I tried to rerun the /usr/bin/mysql_init_db, but after that, I didn't find that the root password is set to empty. I still can't login as any account. What I should do to recreate a mysql database as the same as it fresh installed? I don't have too much data in it. The question is that I don't want to reinstall the whole database. I just want to recreate the database.


Please help. Thanks

The lesson I learned: Don't load any sql script using root!

jeremy 07-25-2002 09:30 PM

You can start MySQL with no permissions and then recreate the mysql database.

http://www.mysql.com/doc/R/e/Resetting_permissions.html

--jeremy


All times are GMT -5. The time now is 10:46 PM.