execute sql file in php?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bro Media - BANNED FOR LIFE
    MOBILE PORN: IMOBILEPORN
    • Jan 2004
    • 16502

    #1

    execute sql file in php?

    I've been trying to get this to work for a long fucking time and its pissing me off, anyone have an idea how to beable to take a sql dump from phpmyadmin, and just run it via a local php script, not phpmyadmin and make it work just the same?
  • Bro Media - BANNED FOR LIFE
    MOBILE PORN: IMOBILEPORN
    • Jan 2004
    • 16502

    #2
    nobody knows?

    Comment

    • nicedreams
      Confirmed User
      • Apr 2004
      • 298

      #3
      Look at this:

      php-mysql-tutorial.com/perform-mysql-backup-php.php

      Jimmy

      Nice Dreams Cash
      http://www.nicedreamscash.com

      Comment

      • Bro Media - BANNED FOR LIFE
        MOBILE PORN: IMOBILEPORN
        • Jan 2004
        • 16502

        #4
        Originally posted by nicedreams
        Look at this:

        php-mysql-tutorial.com/perform-mysql-backup-php.php

        Jimmy
        that works to an extent i just keep getting this

        "Table 'wpjm.wp_comments' doesn't exist"

        because there is nothing in the table, so how can i do it with a blank database?

        Comment

        • SCORE Ralph
          Confirmed User
          • Mar 2003
          • 2090

          #5
          If there is nothing on the table, what is it you're trying to dump?
          GetSCORECash.com | In the Biz Since 1991
          Big Tits | Granny & MILFs | Amateurs | Big Booty | Foot Fetish | BBW | Teens
          Hosted Embeds | MP4s | RSS Feeds | FHGs | Model Directory

          Comment

          • Bro Media - BANNED FOR LIFE
            MOBILE PORN: IMOBILEPORN
            • Jan 2004
            • 16502

            #6
            trying to dump a sql file to create tables and shit

            Comment

            • 2012
              So Fucking What
              • Jul 2006
              • 17189

              #7
              Originally posted by Jaysin
              that works to an extent i just keep getting this

              "Table 'wpjm.wp_comments' doesn't exist"

              because there is nothing in the table, so how can i do it with a blank database?
              i know this sounds really fucking dumb but ...
              whatever you're using is missing that step.

              You need to create the table before you can populate it.

              Create Table ...
              insert into ....
              best host: Webair | best sponsor: Kink | best coder: 688218966 | Go Fuck Yourself

              Comment

              • Chariott
                Confirmed User
                • Nov 2006
                • 361

                #8
                Not sure I understand it completely but which SQL file would you like to get executed? If you have a large dump and phpmyadmin just halts, it is much better to use mysqldump via ssh and direct its output to a file. Such as:

                /usr/local/bin/mysqldump --all-databases --user=NAME --password=PASS > my-dump.sql

                You can simply import this dump.sql (which is full of queries) into mysql later again using /usr/local/bin/mysql utility.

                I hope this will help

                UUGallery v3.37 builder plugin for Wordpress!
                Now it builds FLV VIDEO Galleries! It grabs galleries from FHG's, generates thumbnails, resizes originals,
                arranges within your template and posts a gallery within 1 click!
                Start making money right now!
                ICQ# 475-719-552, Email+MSN: msnaddress[-~at~-]uusoftware.com

                Comment

                • latinasscash
                  Registered User
                  • Jul 2005
                  • 95

                  #9
                  It sounds to me like when you are doing your database
                  dump, you are not using the create table option. That
                  way or a load/restore, it will create the tables if they
                  do not already exist.
                  ____________________________________________

                  Hot All Latin Content...
                  Recurring Partnership Program...
                  Content and tours that convert and retain members...

                  Comment

                  • Bro Media - BANNED FOR LIFE
                    MOBILE PORN: IMOBILEPORN
                    • Jan 2004
                    • 16502

                    #10
                    well, the first line in the sql dump is "CREATE TABLE `wp_comments`"

                    so i guess it works, but the command in that example requires you to set a table to dump to, which i had to set it to something thats not there due to having no tables in the database

                    pretty much what im trying to do is make a script that all i give is mysql login info, a database name, and it will do what the sql file says, which is a bunch of create tables and insert into tables, the sql file is a mysql dump from wordpress

                    Comment

                    Working...