exporting mysql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy Levy

    exporting mysql

    Hi

    there is a function in phpmyadmin that exports all the data etc from a mysql
    database to an sql text document, or Excel File.

    I would like to know if there is an inherent way of doing this without
    phpmyadmin. - straight through php.

    thank you

    andy



  • Dan Tripp

    #2
    Re: exporting mysql

    Andy Levy wrote:
    [color=blue]
    > Hi
    >
    > there is a function in phpmyadmin that exports all the data etc from a mysql
    > database to an sql text document, or Excel File.
    >
    > I would like to know if there is an inherent way of doing this without
    > phpmyadmin. - straight through php.
    >
    > thank you
    >
    > andy
    >[/color]

    mysqldump will do this for you.

    Usage: mysqldump [OPTIONS] database [tables]



    From a php script, you could probably use exec();



    - Dan

    Comment

    • Carlos Marangon

      #3
      Re: exporting mysql

      Hello!


      I am also looking for that.

      As far I know PhpMyAdmin can easily be installed in any PHP server,
      with MySQL support.
      I have it installed even in my localhost.

      If nobody else gives you a direct answer,
      I think you can look inside of PhpMyAdmin code and
      locate the part of the code that do it.

      If nobody else answer I will try to do it,
      because as you, I also need this code.
      And worse, I need to export MySQL to Access.


      Download PhpMyAdmin from



      []

      Carlos

      "Andy Levy" <andy_levy@hotm ail.com> wrote in message news:<v%sTb.135 30$qg.4075@news-binary.blueyond er.co.uk>...[color=blue]
      > Hi
      >
      > there is a function in phpmyadmin that exports all the data etc from a mysql
      > database to an sql text document, or Excel File.
      >
      > I would like to know if there is an inherent way of doing this without
      > phpmyadmin. - straight through php.
      >
      > thank you
      >
      > andy[/color]

      Comment

      • Tim Van Wassenhove

        #4
        Re: exporting mysql

        On 2004-02-03, Carlos Marangon <area48@hotmail .com> wrote:[color=blue]
        > "Andy Levy" <andy_levy@hotm ail.com> wrote in message
        > news:<v%sTb.135 30$qg.4075@news-binary.blueyond er.co.uk>...[color=green]
        >> Hi
        >>
        >> there is a function in phpmyadmin that exports all the data etc from
        >> a mysql
        >> database to an sql text document, or Excel File.[/color][/color]




        --

        Comment

        • Rahul Anand

          #5
          Re: exporting mysql

          "Andy Levy" <andy_levy@hotm ail.com> wrote in message news:<v%sTb.135 30$qg.4075@news-binary.blueyond er.co.uk>...[color=blue]
          > Hi
          >
          > there is a function in phpmyadmin that exports all the data etc from a mysql
          > database to an sql text document, or Excel File.
          >
          > I would like to know if there is an inherent way of doing this without
          > phpmyadmin. - straight through php.
          >
          > thank you
          >
          > andy[/color]

          You can use MySQL command *mysqldump* to generate SQL Text file for
          databases and tables. You can also run this command in a PHP script by
          calling system command.

          To dump your data in Excel Portable file, you can use MySQL command:

          SELECT *
          INTO OUTFILE "/tmp/result.text"
          FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
          LINES TERMINATED BY "\n"
          FROM test_table;

          This will dump data in CSV format, which can be read by MS Excel
          program.

          --
          Hope it will help,
          Rahul Anand

          Comment

          Working...