Jump to content
php.lv forumi

Problēma ar konektēšanos datubāzei


winstons

Recommended Posts

Sveiki man rādās šāda kļūda :

Warning: mysql_query() [function.mysql-query]: Access denied for user 'watching'@'localhost' (using password: NO) in /home/watching/public_html/comment/cmt-display.php on line 2

 

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/watching/public_html/comment/cmt-display.php on line 2

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/watching/public_html/comment/cmt-display.php on line 5

 

Nevaru saprast kas par problēmu , lūdzu palīdziet .

Link to comment
Share on other sites

Warning: mysql_query() [function.mysql-query]: Access denied for user 'watching'@'localhost' (using password: NO)

Te viss ir pateikts - lietotājam watching, kas konektējās pie datubāzes uz adresi "localhost" nelietojot paroli, nav tiesību piekļūt datubāzei. Pārbaudi DB tiesības.

Link to comment
Share on other sites

Man liekas problēma ir tamā , ka man webs ir uz hosta un users ir taisīts caur cpaneli, useru es taisīju ar vārdu dog bet kad biju uztaisījis mna parādīja ka users ir watching_dog, bet ar watching_dog useri es varu konektēties datubāzei bet nevaru nekā izdarīt talāk jo saka, ka nav privilēģiju, kaut gan visas es saliku , ja meginu tikai ar dog useri tad vispār nekonektējas bet parāda ka ar paroli YES .

Nezinat kas varētu būt par problēmu ?

Link to comment
Share on other sites

Tavu jūzeri sauc "watching_dog" (tavā kļūdu paziņojumā rakstīts, ka konektējies ar "watching"). Paskaties vai ir saliktas visas privilēģijas. Un tad:

$server = "127.0.0.1"; //vai arī skaties kāds tev ir pie hostotāja, gan jau, ka tāds arī ir
$user = "watching_dog";
$pass = "parole"; //tava parole

$connection = mysql_connect($server, $user, $pass);
$result = mysql_query("SELECT * FROM table");
$row = mysql_fetch_assoc($result);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...