alib_15 0 Report post Posted September 27, 2009 Hi. Does anyone know how to export a database from Wamp using phpMyAdmin?When I have tried to do this, it creates an SQL file containing the tables and data. Then when I try to import I get the error message - No Database Selected.So I have to create a database and then import the tables.Is there a way to create one file that includes the database itself?Thanks for any help.Ali Quote Share this post Link to post Share on other sites
dsonesuk 874 Report post Posted September 27, 2009 you have to first create the database to insert the table and data into.then you insert 'use yourdbname;' (without quotes) into the sql file above instructions for creating tables and inserting data.example:use yourdbname;CREATE TABLE `mytable` ( `Descrip` varchar(40) NOT NULL default '',.............blah, blah, blah Quote Share this post Link to post Share on other sites
alib_15 0 Report post Posted September 28, 2009 (edited) I was using the wrong export button I think ..I used the export button after selecting my database when I should have used the export buttonon the Home page. This creates a SQL file with the line -CREATE DATABASE dbnameAlip.s. I bet I'm not the first .. Edited September 28, 2009 by alib_15 Quote Share this post Link to post Share on other sites
dsonesuk 874 Report post Posted September 28, 2009 hosting servers create databases for you to use, so you don't have the option to name it yourself. so you have to add 'use thisdatabase'.but if have the option to create and name, Try it!, but place it above 'use database' statement as you have to create before you can use it. Quote Share this post Link to post Share on other sites
alib_15 0 Report post Posted September 28, 2009 thanks I think its all good now-- Database: `abcmaths`--CREATE DATABASE `abcmaths` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;USE `abcmaths`;I appreciate the help.Ali Quote Share this post Link to post Share on other sites