Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
$ mysqldump -u user -p db < /home/user/Desktop/backup.sql


Enter password: 
-- MySQL dump 10.13  Distrib 5.1.41, for debian-linux-gnu (x86_64)
--
-- Host: localhost    Database: dev
-- ------------------------------------------------------
-- Server version   5.1.41-3ubuntu12.3

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2010-07-15 16:45:35

Out of the 61 MB sql file exported via PHPMyAdmin I show no tables in the dev database..... any ideas?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

You're using the command mysqldump, you should use the command mysql. You can also source /home/user/Desktop/backup.sql; from within the mysql client interactively.

share|improve this answer

Is it a typo here on site or are you using incorrect redirection?

It should be like this:

$ mysqldump -u user -p db > /home/user/Desktop/backup.sql
share|improve this answer
    
Webnet states in his original question, "I show no tables in the dev database" –  Warner Jul 15 '10 at 21:36
1  
I wonder then what 61Mb export does include? –  Alex Jul 15 '10 at 22:36

So the correct format is:

$ mysql -uuser -p db < /home/user/Desktop/backup.sql

Another shell method is to use the mysqlimport command

mysqlimport [options] db_name textfile1 [textfile2 ...]

So in your case

mysqlimport -uuser -ppassword --local db /home/userDesktop/backup.sql
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.