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-30-2010, 08:59 AM   #1
Glenn D.
Member
 
Registered: May 2009
Location: ACT - Australia
Distribution: Opensuse x86_64 (Latest)
Posts: 87

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


Hello
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 @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
 
Old 07-30-2010, 09:12 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

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

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

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


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

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