importing a complete database

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Spiesshofer

    #1

    importing a complete database

    Hi,

    I have a MySQL .sql file that contains not only a single table but several,
    its a dump from a complete database.

    How can I import that back into a MySQL Server? MySQLImport seems not to be
    able to handle complete databases, each table has to have it's own
    textfile... or am I wrong there?

    if yes, what would be the typical command?


    thanks

    Oliver

  • Aggro

    #2
    Re: importing a complete database

    Oliver Spiesshofer wrote:[color=blue]
    > Hi,
    >
    > I have a MySQL .sql file that contains not only a single table but several,
    > its a dump from a complete database.
    >
    > How can I import that back into a MySQL Server? MySQLImport seems not to be
    > able to handle complete databases, each table has to have it's own
    > textfile... or am I wrong there?
    >
    > if yes, what would be the typical command?[/color]

    If you have created database already then for example:
    mysql -u root -p databasename < yoursqlfile.sql

    Comment

    • Aggro

      #3
      Re: importing a complete database

      Oliver Spiesshofer wrote:[color=blue]
      > Hi,
      >
      > I have a MySQL .sql file that contains not only a single table but several,
      > its a dump from a complete database.
      >
      > How can I import that back into a MySQL Server? MySQLImport seems not to be
      > able to handle complete databases, each table has to have it's own
      > textfile... or am I wrong there?
      >
      > if yes, what would be the typical command?[/color]

      If you have created database already then for example:
      mysql -u root -p databasename < yoursqlfile.sql

      Comment

      • Aggro

        #4
        Re: importing a complete database

        Oliver Spiesshofer wrote:[color=blue]
        > Hi,
        >
        > I have a MySQL .sql file that contains not only a single table but several,
        > its a dump from a complete database.
        >
        > How can I import that back into a MySQL Server? MySQLImport seems not to be
        > able to handle complete databases, each table has to have it's own
        > textfile... or am I wrong there?
        >
        > if yes, what would be the typical command?[/color]

        If you have created database already then for example:
        mysql -u root -p databasename < yoursqlfile.sql

        Comment

        • Chuck Gadd

          #5
          Re: importing a complete database

          On Mon, 09 Feb 2004 13:07:54 GMT, Oliver Spiesshofer
          <oliver@email.c om> wrote:
          [color=blue]
          >Hi,
          >
          >I have a MySQL .sql file that contains not only a single table but several,
          >its a dump from a complete database.
          >
          >How can I import that back into a MySQL Server? MySQLImport seems not to be
          >able to handle complete databases, each table has to have it's own
          >textfile... or am I wrong there?[/color]

          MySqlImport is intended for data-dump files (containing delimited
          data), not sql script files.

          To make the Mysql client run a sql script, from inside the client, do

          mysql> source myscript.sql;



          Chuck Gadd

          Comment

          • Chuck Gadd

            #6
            Re: importing a complete database

            On Mon, 09 Feb 2004 13:07:54 GMT, Oliver Spiesshofer
            <oliver@email.c om> wrote:
            [color=blue]
            >Hi,
            >
            >I have a MySQL .sql file that contains not only a single table but several,
            >its a dump from a complete database.
            >
            >How can I import that back into a MySQL Server? MySQLImport seems not to be
            >able to handle complete databases, each table has to have it's own
            >textfile... or am I wrong there?[/color]

            MySqlImport is intended for data-dump files (containing delimited
            data), not sql script files.

            To make the Mysql client run a sql script, from inside the client, do

            mysql> source myscript.sql;



            Chuck Gadd

            Comment

            • Chuck Gadd

              #7
              Re: importing a complete database

              On Mon, 09 Feb 2004 13:07:54 GMT, Oliver Spiesshofer
              <oliver@email.c om> wrote:
              [color=blue]
              >Hi,
              >
              >I have a MySQL .sql file that contains not only a single table but several,
              >its a dump from a complete database.
              >
              >How can I import that back into a MySQL Server? MySQLImport seems not to be
              >able to handle complete databases, each table has to have it's own
              >textfile... or am I wrong there?[/color]

              MySqlImport is intended for data-dump files (containing delimited
              data), not sql script files.

              To make the Mysql client run a sql script, from inside the client, do

              mysql> source myscript.sql;



              Chuck Gadd

              Comment

              Working...