-
08.03.2011, 14:37 #1
MySQL Access denied for user update@localhost
Code:7. <?php 8. $link = mysql_connect('localhost', 'update', '123'); 9. echo $_GET['var1']; //Username 10. echo $_GET['var2']; //Menge 11. { 12. mysql_query("INSERT INTO speichern (var1, var2) VALUES ('".mysql_real_escape_string($var1)."', '".mysql_real_escape_string($var2)."')"); 13. } 14. ?>
Code:Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'update'@'localhost' (using password: YES) in C:\Users\Square\Desktop\xampp-win32-1.7.4-VC6\xampp\htdocs\updatecheck.php on line 8 testtest2 Notice: Undefined variable: var1 in C:\Users\Square\Desktop\xampp-win32-1.7.4-VC6\xampp\htdocs\updatecheck.php on line 12 Notice: Undefined variable: var2 in C:\Users\Square\Desktop\xampp-win32-1.7.4-VC6\xampp\htdocs\updatecheck.php on line 12
hilfe :@
/E
Lines dazugetan, damit man die fehler auch lokalisieren kann^^
-
08.03.2011, 14:39 #2
MySQL Bockt bei connect rum :/
XAMPP, hast du überhaupt ein Passwort gesetzt? Normalerweise hat der Standarduser "root" ja kein Passwort, also using password = NO.
Wie die Fehlermeldung schon sagt kann sich der User nicht verbinden, demnach sind die Zugangsdaten "User" oder "Password" definitiv falsch...
-
08.03.2011, 14:52 #3
MySQL Bockt bei connect rum :/
hab ja den user "update" angelegt, der hat atm zum test das pw 123,
habbs mehrmals geprüft und auch öfter neu gesetzt^^
-
08.03.2011, 15:36 #4
MySQL Bockt bei connect rum :/
Du wählst keine Datenbank aus?!?
-
08.03.2011, 16:30 #5
MySQL Bockt bei connect rum :/
okay...
hab das ganze etwas abgeändert:
PHP-Code:<?php
$username="update";
$password="123";
$database="update";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
echo $_GET['var1']; //Username
echo $_GET['var2']; //Menge
{
mysql_query("INSERT INTO update (var1, var2) VALUES ('".mysql_real_escape_string($var1)."', '".mysql_real_escape_string($var2)."')");
}
mysql_close();
?>
allerdings immernoch:
Notice: Use of undefined constant localhost - assumed 'localhost' in C:\Users\Square\Desktop\xampp-win32-1.7.4-VC6\xampp\htdocs\updatecheck.php on line 11
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'update'@'localhost' (using password: YES) in C:\Users\Square\Desktop\xampp-win32-1.7.4-VC6\xampp\htdocs\updatecheck.php on line 11
Unable to select database
ich dreh hier echt noch durch Oo
user update hab ich neu erstell + zugehörige DB auf die er alle rechte hat...
line 11 is btw der connect befehl:
PHP-Code:mysql_connect(localhost,$username,$password);
-
08.03.2011, 16:37 #6
MySQL Bockt bei connect rum :/
Der Server ist ein String, keine Konstante oder Variable. Demnach "localhost" und nicht localhost.
-
08.03.2011, 16:39 #7
MySQL Bockt bei connect rum :/
Well done
connect kriegt er hin, aber immernoch das prob mit dem acces denied :/
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'update'@'localhost' (using password: YES) in C:\Users\Square\Desktop\xampp-win32-1.7.4-VC6\xampp\htdocs\updatecheck.php on line 11
Unable to select database
-
08.03.2011, 16:48 #8
MySQL Bockt bei connect rum :/
Schreibe immer deinen Source dazu. Maan xd
-
08.03.2011, 16:53 #9
MySQL Bockt bei connect rum :/
Also, nach langer google session war das einzie ergebniss ich solle statt XAMPP den WampServer2 nutzen,
gelesen, getan.
Fehler bleibt der gleiche, sieht nur stylischer aus
Source diesmal komplett):
PHP-Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PX Update Check</title>
</head>
<?php
$username="update";
$password="123";
$database="update";
mysql_connect("localhost",$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
echo $_GET['var1']; //Username
echo $_GET['var2']; //Menge
{
mysql_query("INSERT INTO update (var1, var2) VALUES ('".mysql_real_escape_string($var1)."', '".mysql_real_escape_string($var2)."')");
}
mysql_close();
?>
<body>
<p align="center">Simple test
</p>
</body>
</html>
Geändert von Darkfield (18.02.2014 um 10:53 Uhr) Grund: Bilder auf UH geladen
-
08.03.2011, 16:58 #10
MySQL Bockt bei connect rum :/
Am Code ist nichts falsch. Ganz doof gefragt: MySQL Server gestartet?
Ähnliche Themen
-
Xampp Service mysql is not installed Service mysql is not started
Von Essah im Forum WebentwicklungAntworten: 8Letzter Beitrag: 22.03.2014, 22:57 -
Verschenke AmericasNextHotPornStar - Access
Von Roxithro im Forum VerschenkeAntworten: 0Letzter Beitrag: 28.10.2012, 19:58 -
Localhost hat Geburtstag!
Von GXC1 im Forum OffTopicAntworten: 13Letzter Beitrag: 15.06.2012, 18:10 -
[Vorstellung] http://Localhost/
Von Localhost im Forum UserankündigungenAntworten: 8Letzter Beitrag: 11.04.2012, 03:06 -
(A-Info) Zweiwöchentliches Update der "Most Wanted" User
Von Quasar im Forum Knuddels AllgemeinAntworten: 33Letzter Beitrag: 12.05.2011, 07:22
Diese Seite nutzt Cookies, um das Nutzererlebnis zu verbessern. Klicken Sie hier, um das Cookie-Tracking zu deaktivieren.