/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] mysql_connect problem

I created a new user

[code]
GRANT SELECT, INSERT, UPDATE ON db1.consumer TO ‘adam’@’localhost’ IDENTIFIED BY ‘mysite'”;[/code]

How do I alter my connect statement to reflect this?
This is my old statement:

[code]
<?php
$domain=”localhost”;
$user=”admin123″;
$password=”123report”;
$conn = mysql_connect( $domain, $user, $password );
?>
[/code]

Thanks for your help.

Andy

to post a comment
PHP

12 Comments(s)

Copy linkTweet thisAlerts:
@raaamApr 05.2007 — hi...


<?php

$domain="localhost";

$user="adam";

$password="mysite";

$conn = mysql_connect( $domain, $user, $password );

?>
Copy linkTweet thisAlerts:
@1andywauthorApr 05.2007 — Tried that. It returns 'access denied for user 'adam@localhost' USING PASSWORD 'YES'.

I am only connecting successfully when the user has full privileges on the entire database. I am attempting to match the level of need to the level of access.

Thanks,

Andy
Copy linkTweet thisAlerts:
@bokehApr 06.2007 — is it mysql 4.1.x?
Copy linkTweet thisAlerts:
@1andywauthorApr 06.2007 — bokeh,

version 4.0.15-nt

Andy
Copy linkTweet thisAlerts:
@bokehApr 06.2007 — This is a known problem. Do a search in google for "mysql old passwords"
Copy linkTweet thisAlerts:
@1andywauthorApr 06.2007 — Thank you.

Andy
Copy linkTweet thisAlerts:
@1andywauthorApr 08.2007 — I am making progress!

I have updated mySql to version 4.1.22.

I am now running Apache 1.3.28, php 4.3.9, and they are playing nice with mySql 4.1.22. My scripts seem to work as designed, so far.

However, phpmyadmin 2.10.0.2 won't cooperate. It returns an error:

"1045 - Access denied for user: 'myusername@localhost' (using password: Yes)

I have amended the config file to include the correct password.

Do compatibility issues exist with phpmyadmin and mySql 4.1.22?

Thanks,

Andy
Copy linkTweet thisAlerts:
@bokehApr 08.2007 — The software you are using is 3 years old; if you want useful advice update to modern versions that everyone else is using (Apache 2.2.4, PHP 5.2.1, phpMyAdmin 2.10.0.2, MySQL 5.0.3).
Copy linkTweet thisAlerts:
@1andywauthorApr 08.2007 — I am attempting to keep on my development pc, programs similar to the ISPs upon which the scripts will be hosted.

I am at this time, working on two separate ISPs running

Apache 1.3.3

php 4.4.4

mySql 4.1.21

I worry that if I upgrade my development environment, I will cause more problems when I deploy the scripts.

I would love the direct my clients to hosts that use the programs you list but that ain't going to happen.

I appreciate your help, Bokeh.

Sincerely,

Andy
Copy linkTweet thisAlerts:
@bokehApr 08.2007 — Have you reset MySQL to old-passwords?

http://dev.mysql.com/doc/refman/4.1/en/old-client.html
Copy linkTweet thisAlerts:
@1andywauthorApr 08.2007 — Yes I have.

Currently, a query "SELECT * FROM users" (db mysql) returns "localhost | root | 3dec706745829e74". That is OLD_PASSWORD(andrew).

The config.ini.php for phpmyadmin shows:

$cfg['Servers'][$i]['user'] = 'root';

$cfg['Servers'][$i]['host'] = 'localhost';

$cfg['Servers'][$i]['password'] = 'andrew';

When I attempt to load phpmyadmin, the error message is:

" MySQL said: Documentation

#1045 - Access denied for user 'andy'@'localhost' (using password: YES) "

I am not sure where phpmyadmin is finding this old information for user 'andy'@'localhost'.

I have shut down and rebooted but the error stays the same.

Andy
Copy linkTweet thisAlerts:
@1andywauthorApr 08.2007 — Problem is resolved.

I deleted old files, cleared the cache, rebooted and I am back in business.

Thank you for your help.

Andy
×

Success!

Help @1andyw spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,
)...