If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > attach new database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-09-08, 03:12
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
attach new database

I am having a .sql how can I create (attach) a new database (schema) with it in MySQl 5 ?


the file starts with >>
-- phpMyAdmin SQL Dump
-- version 2.8.0.2


is there any tool without that prompt command ?

I am using MySQl Query Browser or MySQl Administrator and WampServer on Windows XP


thank you

Last edited by anselme; 10-09-08 at 03:24.
Reply With Quote
  #2 (permalink)  
Old 10-09-08, 03:26
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
...and the rest of the file?
usually there is something like
create database <blah> if not exists
or
use database <blah>
if its use database then you need to create the db first..

if you are using MySQL administrator then then select the catalogs
right click int he panel below to create a new schema, remember to set user permissions if appropriate
return to the PHPMyAdmin script and run it
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 10-09-08, 03:41
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
of course the file has many create table ... ans I am executing the code in a new and empty database
if I try to execute the file I get
You tried to execute an empty string . Please type an SQL command into the SQL edit field an execute again

it seems that Mysql Query Browser is unable to understand if there is many line !!!

I am not having PhpAdmin but the file comes from PhpAdmin editor I think

Last edited by anselme; 10-09-08 at 03:49.
Reply With Quote
  #4 (permalink)  
Old 10-09-08, 03:52
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
so edit the file....
or rerun the file in PHPMyAdmin
when you get an error message you usually get a pointer to where the problem lies.
if the file was created in PHPMyAdmin then it should work in PHPMyAdmin (ideally the same version that created it)

at present it looks like its a PHPMyAdmin glitch, rahter thna a MySQL problem... have you checked any forums or support areas for PHPMyAdmin?

you could try running the script in MySQL Query browser
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #5 (permalink)  
Old 10-09-08, 04:24
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
I have not PHPMyAdmin I am using MySQL Query browser
and there is no error in the file

just try to execute

CREATE TABLE `phpbb_auth_access` (
`group_id` mediumint(8) NOT NULL default '0',
.......
) TYPE=MyISAM;


INSERT INTO `phpbb_auth_access` (....


it does not work , it seems that MySQL Query browser doesn't understand a new line , and the file has 173452 lines , with valid code
Reply With Quote
  #6 (permalink)  
Old 10-09-08, 04:34
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
if there is no error in the file what are you being told when it does not work.

is the table being created, does it exist in the db? if so does it match the declaration from the source table

if it already exists then create table statement will fail.. check the manual for details

when I've done this sort of thing before I create the tables in one script, then imported the data in one or more other scripts

if its a very large file then it may need breaking up into chunks, this has the advantage that you can incrementally load blocks of data and try to track down rogue lines

as said before I suspect the issue is the difference between PHPMyAdmin and MySQL and its own products.

what error message are you getting, are you getting any indication of where the error lies.
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #7 (permalink)  
Old 10-09-08, 04:41
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
thank you healdem

as I said the only error is
You tried to execute an empty string . Please type an SQL command into the SQL edit field an execute again

If you try to execute

CREATE TABLE `tb1` (
...... columns here
) TYPE=MyISAM;
a line here


it does not work and I get that message

if you try to execute

CREATE TABLE `tb1` (
...... columns here
) TYPE=MyISAM;
CREATE TABLE `tb2` (
...... columns here
) TYPE=MyISAM;


only the tb2 will be created
Reply With Quote
  #8 (permalink)  
Old 10-09-08, 05:27
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
ok so what is the actual ddl (the create statement) that its choking on
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #9 (permalink)  
Old 10-09-08, 15:20
anselme anselme is offline
Registered User
 
Join Date: Dec 2005
Posts: 266
I am looking for a normal tool to create a new database from sql file
the file has 175 000 lines
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On