Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Posts
    1

    Unanswered: Newbie to MySql question : how to execute multicommand sql script ?

    Hi,
    I 'm using winsql 5.0 + mysql-connector-odbc-3.51.12 + mySql 5.0.21 and I want to initialize a database with a script containing lots of
    create table statements and insert statements. Seems I can only execute one statement at a time. How can I execute the whole script ??
    Tx, L.

  2. #2
    Join Date
    May 2006
    Posts
    24
    copy & paste it in the mysql console!

  3. #3
    Join Date
    Jul 2004
    Posts
    62
    mysql/bin > mysql -uroot -p database_name < sample_script.sql
    sample_script.sql
    create table.....;
    insert ....;
    create table.....;
    insert ....;
    create table.....;
    insert ....;
    create table.....;
    insert ....;

  4. #4
    Join Date
    Jul 2004
    Posts
    62

    Talking

    Greetings,
    the multiline command depends on the tools, but most free tools that i use, like
    MySql console,HeidiSQL,MySQL Front, Navicat did accept multiline script in the query browser...

Posting Permissions

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