alib_15 Posted September 27, 2009 Share 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 Link to comment Share on other sites More sharing options...
dsonesuk Posted September 27, 2009 Share 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 Link to comment Share on other sites More sharing options...
alib_15 Posted September 28, 2009 Author Share Posted September 28, 2009 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 .. Link to comment Share on other sites More sharing options...
dsonesuk Posted September 28, 2009 Share 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. Link to comment Share on other sites More sharing options...
alib_15 Posted September 28, 2009 Author Share 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.