Restore MySQL dump? help

  • How to get mysql to comply with all instructions from a file? Ransacked the entire forum, tried everything I could find, but the instructions are not executed.
    Here is the code:
    Code:
    <?php
    /* Connecting, selecting database */
    $link = mysql_connect("localhost", "root", "")
    or die("Could not connect");
    print "Connected successfully";
    mysql_select_db("000") or die("Could not select database");

    parse_mysql_dump function($url, $ignoreerrors = false) {
    $file_content = file($url);
    //print_r($file_content);
    $query = "";
    foreach($file_content as $sql_line) {
    $tsl = trim($sql_line);
    if (($sql_line != "") && (substr($tsl, 0, 2) != "--") && (substr($tsl, 0, 1) != "#")) {
    $query .= $sql_line;
    if(preg_match("/;\s*$/", $sql_line)) {
    $result = mysql_query($query);
    if (!$result && !$ignoreerrors) die(mysql_error());
    $query = "";
    }
    }
    }
    }

    if(parse_mysql_dump("2.sql")) echo "YES!";
    else echo "NO!";
    ?>

  • This is a (Microsoft) SQL Server Forum, not MySQL. You'd be better posting on a website dedicated to MySQL, or (as much as I dislike it) Stack Overflow for an answer.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • good day to you, you can try to use the method restore using a backup , or to apply to this program which sql repair, I hope I helped you ! Good luck!!!

  • markheine68 - Monday, October 2, 2017 6:10 AM

    good day to you, you can try to use the method restore using a backup , or to apply to this program which sql repair, I hope I helped you ! Good luck!!!

    How does a Microsoft SQL Server Repair tool help with a MySQL database exactly?

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply