Pages: 12Next
Current Page: 1 of 2
Access denied and server connection problem
Posted by: literain (---.saudi.net.sa)
Date: January 11, 2008 09:09PM

Good day to all,

Im new to this forum and would like to ask for your help. After installing everything and run my projects (i used phptriad before) I have the following errors:

Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\Nitco\website\projects.php on line 165

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in C:\wamp\www\Nitco\website\projects.php on line 165
query error

Can anybody pls give me a hint or help me solve the case. Any help would be very much appreciated.

Thanks,
Literain



Edited 1 time(s). Last edit at 01/11/2008 09:23PM by literain.

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: yfastud (Moderator)
Date: January 11, 2008 10:20PM


Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (87.109.230.---)
Date: January 12, 2008 04:12AM

Thank you very much for your reply. Here's my code on the website to connect to server

//function connectdb(){
$connection=mysql_connect("localhost","root","root"winking smiley or "cannot connect to database";
$db=mysql_select_db("nitcotek_main",$connection)or "cannot find database";

I also setup a password on phpmyadmin just like in your tutorial setting up password which is "root". Pls advice.

Thanks,
Literain

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: yfastud (Moderator)
Date: January 12, 2008 05:55AM

Through wamp tray icon, when you click on phpmyadmin, can you login w/ username and password that you setup?

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (---.awalnet.net.sa)
Date: January 12, 2008 06:29AM

hi,

Thanks for the post. Yes I can login.and phpmyadmin is working good. When I use PHPtriad before its not having errors like these. Was there a code on my website I need to fix to create the right connection to the server? Or configuration settings I need to add?

Thank you very much for responding. I hope you can help me.

Thanks,
Literain



Edited 1 time(s). Last edit at 01/12/2008 08:05PM by literain.

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: yfastud (Moderator)
Date: January 12, 2008 04:07PM

Quote

Was there a code on my website I need to fix to create the right connection to the server?
I think so since there is no problem to connect to your db

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (---.saudi.net.sa)
Date: January 12, 2008 06:04PM

Can you pls give me a hint where the problem may be found? If you can, pls provide a code or sample files I can use as reference to make a successful connection?


Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\wamp\www\nitco\index.php on line 80

This is the error I have for all sites I made after moving to wampserver.


$connection=mysql_connect("localhost","root","root"winking smiley or "cannot connect to database";
$db=mysql_select_db("nitcotek_main",$connection)or "cannot find database";

This is the code I use to connect to mysql, is there something wrong? Pls help

Thank you very much.



Edited 1 time(s). Last edit at 01/12/2008 06:17PM by literain.

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (---.saudi.net.sa)
Date: January 12, 2008 08:05PM

I think its working now.

I just need to create the user ODBC on th phpmyadmin and grant privileges and it works. Thanks everyone for your contribution.

Literain

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: yfastud (Moderator)
Date: January 12, 2008 11:16PM

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

When you get that warning mean that you didn't setup password properly for the user that log in, but it didn't mean that you have to create that user; however, if you create that user, later on you can't get that friendly warning even having wrong login w/ different user

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (---.saudi.net.sa)
Date: January 13, 2008 04:14AM

Thank you for the post. Your right now its giving me "query error" message.But when I run it on phptriad its working fine. Can anyone pls give me a hint whats' wrong now?

Thanks,
Literain

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: yfastud (Moderator)
Date: January 13, 2008 05:37AM

Quote

But when I run it on phptriad its working fine
Since you have 2 mysql and they're conflict, so you have to give up 1 in order for the other works

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (---.awalnet.net.sa)
Date: January 13, 2008 05:58AM

hi,

I did. Its on the other computer I'm using. On this computer its only wamp server. Is there any initial configuration I need to do or codes I need to add?

Thanks,
Literain

Regards,

Literain
[www.iproton.net]

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: literain (212.116.219.---)
Date: January 13, 2008 05:59AM

hi,

I did. Its on the other computer I'm using. On this computer its only wamp server. Is there any initial configuration I need to do or codes I need to add?

Can anybody share a sample code that I can make as pattern to connect to the server just to make sure if the problem is in the code or in the server configuration. Thank you in advance.

Thanks,
Literain

Regards,

Literain
[www.iproton.net]

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: vartika (220.225.125.---)
Date: February 13, 2010 07:41PM

I was getting a similar error while running a PHP program in WampServer . I then set up a root password after which I was not able to access my PhpMyAdmin instead I am getting this error.

#1045 - Access denied for user 'root' @ 'localhost' (using password: NO)

phpMyAdmin tried to connect to the MySQl server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQl server.

To get rid of it I had to uninstall and install the Wampserver again because after that error I wasn't getting the option of changing or removing the password again.

What should I do to remove the Access denied error?

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: February 13, 2010 07:48PM

you made a password for mysql

now phpmyadmin cant login to mysql

so open c:/wamp/apps/phpmyadmin/config.inc.php

add your password to the appropriate line and save.


clear browser history, and try again

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: vartika (220.225.125.---)
Date: February 13, 2010 08:06PM

Thanks for replying.
I did make necessary changes as you said but I am again getting the following error.



Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\connectivity.php on line 7
Error connecting to mysql

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: February 13, 2010 08:08PM

this is not the same error.

in fact this error has nothign to do with phpmyadmin now



open this

C:\wamp\www\connectivity.php on line 7

and add your password there too


phpmyadmin shud be working tho now before you do this

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: vartika (220.225.125.---)
Date: February 14, 2010 10:18AM

Thanks my PhpMyAdmin is working perfectly fine now.

Now I am getting the following error when I run the code below:

ERROR--->Unable to select database: Unknown database 'test'

where 'Test' is the database name and 'greendb' is the required table in that.

//CODE

<html>
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'vartika';

$db = mysql_connect($dbhost, $dbuser, $dbpass)
or die ("Unable to connect: " . mysql_error());

mysql_select_db ("Test"winking smiley
or die ("Unable to select database: " . mysql_error());

$query = "SELECT * FROM greendb";

$rs = mysql_query ($query, $db)
or die ("Query failed: " . mysql_error() . " Actual query: " . $query);

if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
print_r($row);
}
}
?>
</html>

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: February 14, 2010 10:29AM

i dunno... it says there is no database called test...
so i guess there is no databse called test?

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Access denied and server connection problem
Posted by: vartika (220.225.125.---)
Date: February 14, 2010 10:32AM

It is there ..The database name is Test and there are two tables under it namely 't1' and 'greendb'.

Any suggestions what should I do now?

Options: ReplyQuote
Pages: 12Next
Current Page: 1 of 2


Sorry, only registered users may post in this forum.