Results 1 to 9 of 9
  1. #1
    Join Date
    Dec 2005
    Posts
    266

    Unanswered: 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 04:24.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ...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 on the Tiger 800 or the Norton

  3. #3
    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 04:49.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  5. #5
    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

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    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 on the Tiger 800 or the Norton

  7. #7
    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

  8. #8
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ok so what is the actual ddl (the create statement) that its choking on
    I'd rather be riding on the Tiger 800 or the Norton

  9. #9
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •