Rayn: .CSV Datei in MySQL Tabelle importieren

Beitrag lesen

Das war mein letzter Versuch:

<?php

$db_MenuTitle[0]  = "Eintrag 1";
          $db_Hostname[0]   = "mysql4.meine-domain.de";
          $db_UserName[0]   = "Mein Username";
          $db_Password[0]   = "Mein Passwort";
          $db_Database[0]   = "Mein Datenbanksname";
          $db_Table[0]      = "Mein Tabellenname";
          $db_File[0]       = "texttest.csv";
          $db_Terminated[0] = ";";

if (isset ($select_db)) {

mysql_connect($db_Hostname[$select_db], $db_UserName[$select_db], $db_Password[$select_db]) || die("Can't Connect to Database: ".mysql_error());
            mysql_select_db($db_Database[$select_db]);

$del = "DELETE FROM ".$db_Table[$select_db];

$sql = "LOAD DATA INFILE '$db_File[$select_db]' REPLACE INTO TABLE ".$db_Table[$select_db]." FIELDS TERMINATED BY '$db_Terminated[$select_db]'";

if (mysql_query ($del) and mysql_query ($sql)) {
                $message = "&Uuml;bertragung erfolgreich";
                }
            else {
                $message = "&Uuml;bertragung fehlgeschlagen. Grund: ". mysql_error ();
                }

}

function generate_dropdown () {

global $db_MenuTitle, $db_Hostname, $db_UserName, $db_Password, $db_Table, $db_File, $db_Terminated;

if (is_array ($db_MenuTitle)) {

reset ($db_MenuTitle);

while (list ($key, $val) = each ($db_MenuTitle)) {
                  echo "<option value="".$key."">".$val."</option>";
                  }

}

}

?>

<html>
  <head>
    <title>CSV to SQL</title>
  </head>
  <body bgcolor="#EAEAEA">
    <form action="<?php echo $PHP_SELF; ?>" method="POST">
      <table border="0" cellspacing="0" cellpadding="5" bgcolor="#C0C0C0" width="50%">
        <tr>
          <th>CSV to MySQL</th>
          <th>&nbsp;</th>
        </tr>
        <tr valign="bottom">
          <td>
            <select name="select_db" size="<?php echo count ($db_MenuTitle); ?>">
              <?php generate_dropdown (); ?>
            </select>
          </td>
          <td>
            <input type="Submit" name="submit" value="Und los!">
          </td>
        </tr>
      </table>
    </form>
    <p><?php echo $message; ?></p>
  </body>
</html>

Folgende Fehlermeldung:

Übertragung fehlgeschlagen. Grund: Access denied for user 'Mein Datenbanksname'@'127.0.0.2' (using password: YES)

Aber die Daten sind richtig und sie funktioniern menütlich aufs neue ... wo ist also der Fehler ??

Rayn