how to import sql file in MysqlQuery browser - mysql
I have used musqldump to create the sql file and now i am trying to use this sql file in mySqlQuery browser to get the complete database .
Here is my sql file which i have placed in mysqlquery browser ,
When i try to execute , it says :
Variable 'sql_notes' can't be set to the value of 'NULL'
here is my sqlFile.
-- MySQL dump 10.13 Distrib 5.5.27, for Win64 (x86)
-- Host: localhost Database: mydb
-- Server version 5.5.27
/*!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 */;
--
-- Current Database: mydb
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mydb` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `mydb`;
--
-- Table structure for table analysismode
DROP TABLE IF EXISTS `analysismode`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `analysismode` (
`AnalysisModeId` int(10) unsigned NOT NULL AUTO_INCREMENT,
`AnalysisModeDesc` varchar(45) NOT NULL,
PRIMARY KEY (`AnalysisModeId`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Dumping data for table analysismode
LOCK TABLES `analysismode` WRITE;
/*!40000 ALTER TABLE `analysismode` DISABLE KEYS */;
INSERT INTO `analysismode` VALUES (1,'Analyse 2050'),(2,'Analyse 2033'), (3,'Analyse 2035'),(4,'Analyse 2044');
/*!40000 ALTER TABLE `analysismode` ENABLE KEYS */;
UNLOCK TABLES;
LOCK TABLES `warranties` WRITE;
/*!40000 ALTER TABLE `warranties` DISABLE KEYS */;
INSERT INTO `warranties` VALUES (8,'des','ty',2,'0000-00-00',1,'2012-11- 27',0,3,4,74),(10,'desc','87',97,'0000-00-00',87,'2012-12-18',0,7,7,84), (11,'desc','87',97,'0000-00-00',87,'2012-12-18',0,7,7,84),(12,'desc','87',97,'0000-00- 00',87,'2012-12-18',0,7,7,84),(13,'desc','87',97,'0000-00-00',87,'2012-12-18',0,7,7,84), (18,'desc','87',97,'0000-00-00',87,'2012-12-18',0,7,7,84),(19,'desc','87',97,'0000-00- 00',87,'2012-12-18',0,7,7,84),(20,'desc','87',97,'0000-00-00',87,'2012-12-18',0,7,7,84), (21,'desc','87',97,'0000-00-00',87,'2012-12-18',0,7,7,84),(22,'desc','type',11,'0000-00- 00',11,'2012-12-25',0,33,11,102),(23,'desc','wa',798,'0000-00-00',768,'2012-12- 25',0,798,789,103),(24,'DESC','786',8,'0000-00-00',8,'2012-12-25',0,88,97,104);
/*!40000 ALTER TABLE warranties ENABLE KEYS /;
UNLOCK TABLES;
/!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 2012-12-09 12:23:41
Related
Restore MySQL from dump: different version and CHARACTER SET
I am moving data from my old database to my new one. The old DB uses: MySQL version 5.5 CHARACTER SET utf8 I created a new database: MySQL version 5.6 create database MY_DB; -- Same name as old DB ALTER DATABASE MY_DB default CHARACTER SET utf8mb4; Create some users, grant some privileges... I want to create the db tables and add the data using a mysql dump file, but am concerned that the dump file will overwrite settings and variables that have been set in the new DB. How do I: Write the dump command such that any wrong / unnecessary settings and the db create statement are not included? This includes DB and table level settings. or Create tables and load data from the dump file, as is, and afterwards set all table and DB settings as they should be in the new DB? These are the create statements and DB settings that I am seeing in the dump file: /*!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 */; CREATE DATABASE /*!32312 IF NOT EXISTS*/ `MY_DB` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `MY_DB`; DROP TABLE IF EXISTS `MY_TABLE`; /*!40101 SET #saved_cs_client = ##character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `MY_TABLE` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(80) NOT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = #saved_cs_client */;
Importing a dump file to MySQL 5.7
I have been trying to import a dump file which I created on a database that contains a table with virtual columns on a server MariaDB version 10.1.9. Here is part of the .sql file : DROP TABLE IF EXISTS `abc`; /*!40101 SET #saved_cs_client = ##character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `abc` ( `a` int(11) DEFAULT NULL, `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = #saved_cs_client */; -- Dumping data for table `abc` LOCK TABLES `abc` WRITE; /*!40000 ALTER TABLE `abc` DISABLE KEYS */; INSERT INTO `abc` VALUES (2,3),(3,4),(3,4),(56,57); /*!40000 ALTER TABLE `abc` ENABLE KEYS */; UNLOCK TABLES; Now since MySQL latest version supports virtual columns, I expected the import to be successful but it failed giving an error: Error Code: 3105 - The value specified for generated column 'b' in table 'abc' is not allowed. Is there any way this error can be averted? And I can import the dump file to with the data to MySQL server version 5.7.11??
I have checked on Version 10.1.10 and this works good. i created first the Table with your CREATE and the i dump it and import it. -- MySQL dump 10.16 Distrib 10.1.10-MariaDB, for osx10.11 (x86_64) -- -- Host: localhost Database: bernd -- ------------------------------------------------------ -- Server version 10.1.10-MariaDB-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 */; /*!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 */; -- -- Table structure for table `abc` -- DROP TABLE IF EXISTS `abc`; /*!40101 SET #saved_cs_client = ##character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `abc` ( `a` int(11) DEFAULT NULL, `b` int(11) AS ((`a` + 1)) VIRTUAL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = #saved_cs_client */; -- -- Dumping data for table `abc` -- LOCK TABLES `abc` WRITE; /*!40000 ALTER TABLE `abc` DISABLE KEYS */; INSERT INTO `abc` VALUES (1,2),(2,3),(3,4),(99,100); /*!40000 ALTER TABLE `abc` ENABLE KEYS */; UNLOCK TABLES; /*!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 2016-02-15 13:50:24
Incorrect syntax when . is there in table name
I have MySQL Workbench 6.0 CE installed on my PC. I have script as follows: CREATE DATABASE IF NOT EXISTS `eh-dbf374d5-f90f-435f-b284-3990e857c46c` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `eh-dbf374d5-f90f-435f-b284-3990e857c46c`; -- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86) -- -- Host: localhost Database: eh-dbf374d5-f90f-435f-b284-3990e857c46c -- ------------------------------------------------------ -- Server version 5.6.15 /*!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 */; -- -- Table structure for table `account.info.csp` -- DROP TABLE IF EXISTS `account.info.csp`; /*!40101 SET #saved_cs_client = ##character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `account.info.csp` ( `id` int(11) NOT NULL AUTO_INCREMENT, `accountInfoID` int(11) NOT NULL, `courseID` int(11) NOT NULL, `sectionID` int(11) NOT NULL, `periodID` int(11) NOT NULL, PRIMARY KEY (`id`,`accountInfoID`,`courseID`,`sectionID`,`periodID`) ) ENGINE=InnoDB AUTO_INCREMENT=34013 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = #saved_cs_client */; -- -- Dumping data for table `account.info.csp` -- LOCK TABLES `account.info.csp` WRITE; /*!40000 ALTER TABLE `account.info.csp` DISABLE KEYS */; INSERT INTO `account.info.csp` VALUES (1,461,3,2,1),(3647,256,49,4,8),(3648,1412,370,6,2),(3649,752,49,12,5),(3650,635,246,12,2),(3651,1878,423,8,1),,(31087,5109,652,3,2),(31088,5109,653,3,3),(31089,5630,654,3,4),(31090,5109,655,3,5),(31091,5109,656,3,8),(31092,5634,658,3,7),(31093,5638,659,3,9),(31094,5648,677,5,3),(31095,5235,679,2,11),(31096,5235,668,2,1),(31097,5235,669,2,2),(31098,5235,670,2,3),(31099,4587,671,2,4),(31100,5235,672,2,5),(31101,5235,673,2,8),(31102,5234,674,2,6),(31103,6640,675,2,7),(31104,5456,679,2,11),(31105,5456,668,2,1),(31106,5456,669,2,2),(31107,5456,670,2,3),(31108,6653,671,2,4),(31109,5456,672,2,5),(31110,5456,673,2,8),(31111,4290,674,2,6),(31112,4625,675,2,7),(31113,4288,676,2,9),(31114,5254,694,2,11),(31115,5254,695,2,1),(31116,5254,696,2,2),(31117,5254,697,2,3),(31118,5254,699,2,5),(31119,5254,700,2,8),(31120,4236,701,2,6),(31121,5253,702,2,7),(31122,5247,703,2,9),(31123,5290,691,4,11),(31124,5290,680,4,1),(31125,5290,681,4,2),(31126,5290,682,4,3),(31127,4252,683,4,4),(31128,5290,684,4,5),(31129,5290,685,4,8),(31130,5299,686,4,6),(31131,5305,687,4,7),(31132,5287,688,4,9),(31133,4909,643,15,11),(31134,4909,680,15,1),(31135,4909,681,15,2),(31136,4909,682,15,3),(31137,4909,683,15,4),(31138,4909,684,15,5),(31139,4909,685,15,8),(31140,4909,686,15,6),(31141,4909,687,15,7),(31142,4909,688,15,9),(31143,6721,679,4,11),(31144,6721,668,4,1),(31145,6721,669,4,2),(31146,6795,671,4,4),(31147,6721,672,4,5),(31148,6721,673,4,8),(31149,4248,674,4,6),(31150,4952,675,4,7),(31151,5279,676,4,9),(31152,4273,679,5,11),(31153,4273,668,5,1),(31154,4273,669,5,2),(31155,4273,670,5,3),(31156,5406,671,5,4),(31157,4273,672,5,5),(31158,4273,673,5,8),(31159,5407,674,5,6),(31160,5408,675,5,7),(31161,5411,676,5,9),(31162,5410,677,4,3),(31163,5523,650,3,11),(31164,5523,651,3,1),(31165,5523,652,3,2),(31166,5546,653,4,3),(31167,5517,654,3,4),(31168,5523,655,3,5),(31169,5523,656,3,8),(31170,5520,657,3,6),(31171,5534,659,3,9),(31172,4649,679,5,11),(31173,4649,668,5,1),(31174,4649,669,5,2),(31175,4315,671,5,4),(31176,4649,672,5,5),(31177,4649,673,5,8),(31178,4786,674,5,6),(31179,6644,675,5,7),(31180,4319,676,5,9),(31181,4251,677,2,3),(31182,5582,679,2,11),(31183,5582,668,2,1),(31184,5582,669,2,2),(31185,4649,670,5,3),(31186,4315,671,2,4),(31187,5582,672,2,5),(31188,5582,673,2,8),(31189,4786,674,2,6),(31190,6644,675,2,7),(31191,4319,676,2,9),(31192,5582,670,2,3),(31193,5084,679,5,11),(31194,5084,668,5,1),(31195,5084,669,5,2),(31196,5084,670,5,3),(31197,6795,671,5,4),(31198,5084,672,5,5),(31199,5084,673,5,8),(31200,4248,674,5,6),(31201,4952,675,5,7),(31202,5279,676,5,9),(31203,6808,679,5,11),(31204,6808,668,5,1),(31205,6808,669,5,2),(31206,6808,670,5,3),(31207,5670,671,5,4),(31208,6808,672,5,5),(31209,6808,673,5,8),(31210,4345,674,5,6),(31211,4348,675,5,7),(31212,4667,676,5,9),(31213,6666,660,2,11),(31214,6666,668,34,1),(31215,6666,669,34,2),(31216,6666,670,34,3),(31217,6666,671,34,4),(31218,6666,672,34,5),(31219,6666,673,34,8),(31220,6666,674,34,6),(31221,6666,675,34,7),(31222,6666,676,34,9),(31223,6667,660,4,11),(31224,6805,670,4,3),(31225,5104,679,5,11),(31226,5104,668,5,1),(31227,5104,669,5,2),(31228,5104,670,5,3),(31229,5556,671,5,4),(31230,5104,672,5,5),(31231,5104,673,5,8),(31232,4313,674,5,6),(31233,5568,675,5,7),(31234,5558,676,5,9),(31235,4241,679,2,11),(31236,5320,691,5,11),(31237,5320,680,5,1),(31238,5320,681,5,2),(31239,5320,682,5,3),(31240,5325,683,5,4),(31241,5320,684,5,5),(31242,5320,685,5,8),(31243,5315,686,5,6),(31244,4257,687,5,7),(31245,4609,688,5,9),(31246,5410,650,4,11),(31247,5410,651,4,1),(33999,4472,327,5,1),(34000,5218,365,3,4),(34001,6617,244,3,4),(34002,5162,2,4,2),(34011,5926,9,10,5),(34012,5969,5,12,7); /*!40000 ALTER TABLE `account.info.csp` ENABLE KEYS */; UNLOCK TABLES; /*!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 2014-05-05 12:01:08 When i run above script: it gives me following error. Error Code: 1103. Incorrect table name 'account.info.csp' The error is only when i put dot(.) in between table name. I have run same script on my co-workers machine, with same MySqlWorkbench 6.0. It ran successfully and tables got created with dot(.) in between there table names. Is there any setting i will have to do for this to run?? Or any other alternative???? Edit: Version : EDIT2:
Your insert statement has 1 extra comma as showing below after entry (3651,1878,423,8,1),,. just erase it and try. INSERT INTO `account.info.csp` VALUES (1,461,3,2,1),(3647,256,49,4,8),(3648,1412,370,6,2),(3649,752,49,12,5),(3650,635,246,12,2),(3651,1878,423,8,1),,(31087,5109,652,3,2)
MySql - Error 1064 - Can't Find Syntax Error
This is the output from a mysqldump. I haven't changed anything but I'm getting an Error 1064 near line 1 which I'm assuming is the first non-commented line. Can anyone spot my syntax error? -- MySQL dump 10.13 Distrib 5.5.30, for Linux (x86_64) -- -- Host: localhost Database: dbname_email -- ------------------------------------------------------ -- Server version 5.5.30-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; */; /*!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 */; -- -- Table structure for table `Newsletter_Emails` -- DROP TABLE IF EXISTS `Newsletter_Emails`; /*!40101 SET #saved_cs_client = ##character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Newsletter_Emails` (`Email` varchar(100) DEFAULT NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = #saved_cs_client */; Thanks for any help.
The problem is here: /*!40101 SET NAMES utf8; */; Apparently, it's caused by the ; delimiter inside the conditional comment. This works as expected: /*!40101 SET NAMES utf8 */;
restoring mysql database from dump file unknown database error
I'm having trouble restoring from a dump file. The dump file has an option to build the database if it doesn't exist. So why does the script below only works when I have the database. mysql -u root -p1234 modal_db < c:\wamp\db_backups\modal_db\mdb.sql Here's the dump file -- MySQL dump 10.13 Distrib 5.5.8, for Win32 (x86) -- -- Host: localhost Database: modal_db -- ------------------------------------------------------ -- Server version 5.5.8-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 */; /*!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 */; -- -- Current Database: `modal_db` -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ `modal_db` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `modal_db`; -- -- Table structure for table `user_info` -- DROP TABLE IF EXISTS `user_info`; /*!40101 SET #saved_cs_client = ##character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `user_info` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(30) NOT NULL, `email` varchar(30) NOT NULL, `password` varchar(30) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = #saved_cs_client */; -- -- Dumping data for table `user_info` -- LOCK TABLES `user_info` WRITE; /*!40000 ALTER TABLE `user_info` DISABLE KEYS */; INSERT INTO `user_info` VALUES (1,'[object Object]','[object Object]','[object Object]'),(2,'amaya','etongancheta#yahoo.com','neato'),(3,'yoh','yoh#yahoo.com','ff2cbe54328162379ba1baf57b23f9'),(4,'fure','fure#gmail.com','263bce650e68ab4e23f28263760b9f'),(5,'koroja','koroja#yahoo.com','665b3a3829375f4acbb00858299a08'),(6,'maro','ala#yahoo.com','2f66aed2714edaa599e148990c9d16'),(7,'deg','deg#ymail.com','n'),(8,'mario','super_mario#gmail.com','c1210473c214e0cf5968bf147ed079'),(9,'mizuo','hewajim#y.com','n'),(10,'bakuryu','bakuryu#b.com','b'),(11,'maron','m#yahoo.com','m'),(12,'gatou','g#y.com','g'),(13,'mocha','mo#y.com','mo'),(14,'pizza','pizza#gm.com','gm'),(15,'bbq','bbq#food.com','food'),(16,'salad','salad#s.com','s'); /*!40000 ALTER TABLE `user_info` ENABLE KEYS */; UNLOCK TABLES; /*!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 2011-06-12 21:53:48 Please help. How do I restore the database if it has been dropped?
Your MySQL command line is attempting to choose a database, which will fail if the database doesn't exist. You can omit that from your command line arguments as the SQL file is choosing a database itself with USE. Try: mysql -u root -p1234 < c:\wamp\db_backups\modal_db\mdb.sql