Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-22-2010, 05:16 AM   #1
Glenn D.
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 127

Rep: Reputation: 16
mysql restore database and id commands

I used this command to Backup a mysql database [name is cacti]
- /usr/bin/mysqldump -uroot -proot cacti > cacti-metadata-backup.sql

How do I restore Restore this database, on a system that has a clean install of mysql on it.

Also I need to restore the owner of this data [in this case cacti]
How do I restore the owner and password for create a new one.
Old 07-22-2010, 07:36 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,293

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335

The password is not included in the backup. So you need to find the password somewhere else, or just make up a new one.

Anyway, to restore that backup, you first create the database, grant access to it, and then pipe the sql file into mysql. Something like this:

mysql -u root -proot
create database cacti;
grant all privileges on cacti.* to cacti@localhost identified by 'cactipassword';
mysql -u root -proot cacti <cacti-metadata-backup.sql

This assumes the root password is root. I suggest you change it to something else.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restore MySQL Dump File But I want it to restore with different names? helptonewbie Linux - Newbie 5 07-08-2009 05:09 AM
mysql database restore help compused Linux - General 3 10-28-2008 04:48 PM
Restore Database RAH104 Linux - Server 3 07-05-2008 09:49 PM
mysql database restore problem sajith Programming 1 07-01-2007 06:36 AM
How do I restore a MySQL database simply dobriain Linux - Software 2 04-19-2006 12:05 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:49 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration