LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices



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

Rep: Reputation: 16
mysql restore database and id commands


Hello,
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, 08:36 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,159

Rep: Reputation: 258Reputation: 258Reputation: 258
Hi

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';
quit
mysql -u root -proot cacti <cacti-metadata-backup.sql

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


Reply


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 06:09 AM
mysql database restore help compused Linux - General 3 10-28-2008 05:48 PM
Restore Database RAH104 Linux - Server 3 07-05-2008 10:49 PM
mysql database restore problem sajith Programming 1 07-01-2007 07:36 AM
How do I restore a MySQL database simply dobriain Linux - Software 2 04-19-2006 01:05 PM


All times are GMT -5. The time now is 12:21 PM.

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