Mysql Dump import export restore
Dont mix mysqldump and mysql commands when you try to import/restore. Following shell command gives no error but creates just an empty file.
mysqldump -u USERNAME -pPASSWORD YOUR_DATABASE_NAME < YOUR_DB.sql Enter password: -- MySQL dump 10.11 -- -- Host: localhost Database: YOUR_DATABASE_NAME -- ------------------------------------------------------ -- Server version 5.0.51a-3ubuntu5.4 /*!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 2009-09-04 12:23:23
To solve it use mysql instead of mysqldump. And remember when you export a database to a .sql file uye mysqldump.
mysqldump -u username -p *** database_name > dbname.sql
Similar entries
- Replace string in big database or large text file
- Backup all MySQL databases automagicly with the PHP admin script
- [Howto Fix] Table './eximstats/sends' is marked as crashed and should be repaired
- Import Dmoz / ODP data to mysql
- PHP code examples for beginners
- Import big SQL Files under WAMP or LAMP ?
- #1045 Cannot log in to the MySQL server (PhpMyAdmin 2.4.8)
- #2006 - MySQL server has gone away
- Howto log slow MySQL Queries in Debian
- Configure phpMyAdmin to login automagicly without prompted for username and password
- Page generation time and http-referers with PHP
- How to select a secure password for your online logins
- url encode decode directly with mysql
- Howto read/export firefox cookies in linux
- Using shared same Mysql Data dir on multiOS Linux+Windows Laptop
- How install Apache, Mysql and PHP on Notebook
- Filezilla and plain-text clear, unsecure password storage
- Free Web-Hosting with PHP-MYSQL, FTP and no-ads
- Mysql replace with regexp
- E: Sub-process /usr/bin/dpkg returned an error code (1)

Post new comment