Visit Jeremy's Blog.
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-30-2010, 07:59 AM   #1
Glenn D.
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 127

Rep: Reputation: 16
How do I Restore a mysql database ?

How do I restore a mysql database I need the syntax please.
Thanks Glenn

The backup was done via crontab line.
> /usr/bin/mysqldump -uuserid -ppassword cacti > /backups/cacti-data-backup.sql

> first few lines of dumpfile
head cacti-metadata-backup.sql
-- MySQL dump 10.13 Distrib 5.1.46, for suse-linux-gnu (x86_64)
-- Host: localhost Database: cacti
-- ------------------------------------------------------
-- Server version 5.1.46-log

/*!40101 SET NAMES utf8 */;
Old 07-30-2010, 08:12 AM   #2
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
use below command to restore mysql backup

/usr/bin/mysqldump -uuserid -ppassword -h localhost cacti < /backups/cacti-data-backup.sql
mysql -u user -p DATABASENAME < /path/to/backup.sql

Last edited by sem007; 07-30-2010 at 08:14 AM.


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
mysql restore database and id commands Glenn D. Linux - Software 1 07-22-2010 07:36 AM
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
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 01:30 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