Jump to content
xisto Community
Sign in to follow this  
soleimanian

Problem Accessing A Database In My Local System

Recommended Posts

OK so I set up php, apache and mysql. I am having a problem accessing a database however on my local machine. (Must excuse me if thats not the right terminology)I've looked around in the privileges on phpmyadmin and the mysqladmin and i can't figure it out.The file I use to connect to the database is configured fine with password and username and all that and I've checked, double checked and triple checked to make sure.So when I try to test a page that has to access the database it only echo's the html bits and then I get this error...Warning: mysql_connect(): Access denied for user: 'soleiman@localhost' (Using password: YES) in c:\appserv\www\fantemplate\dbconnect.php on line 2Is there possibly something In a config or ini file that I have to adjust. I am oblivious to these things so if anyone can give some details I would greatly appreciate it...

Share this post


Link to post
Share on other sites

Can you use the same set of credentials (login/pass) to login using the MySQL command line client ? If you cannot, that'll explain why the connection is being refused.That error message you're getting, in 99% of cases, arises out of wrong password/username combination - OR, not allowed Host Mask in mysql.user table.Try using the command line client and let me know.

Share this post


Link to post
Share on other sites

hi,yeh i had the SAME problem, and i still have it, it really sucks, i dont know why but when i try to connect with php it says connection type unsupported, upgrade mySQL. i tried installing a new version from 4.1 but same error. i have to now only use scripts without mySQL

Share this post


Link to post
Share on other sites

Lets start from the start, how did you create the username and password for your database? Any particular program or did you use the MySQL command prompt.What version of PHP and MySQL are you using, there were changes in MySQL databases that made passwords incompatible with older versions, if you were using a newer database with an old database you had to perform the upgrade.Unfortunately I just got a call and have to leave now, so I can't explain the process I would take, but I would start right back at the start, using the MySQL command prompt, or you could use phpMyAdmin, but you must look over the configuration file and make sure which method of MySQL it's using, mysql or mysqli, if using mysqli then you'd have to use the mysqli_connect method (only supported in PHP5).Cheers,MC

Share this post


Link to post
Share on other sites

hi,

yeh i had the SAME problem, and i still have it, it really sucks, i dont know why but when i try to connect with php it says connection type unsupported, upgrade mySQL. i tried installing a new version from 4.1 but same error. i have to now only use scripts without mySQL

1064331142[/snapback]


This problem is NOT related to the problem soleimanian stated. What you say is a quite a common occurence, and it arises out of PHP being NOT COMPILED with the --with-mysqli suffix, which doesn't allow it to communicated properly with mysql 4.1.x. The only fix it to compile PHP again with that suffix and all will be fine.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.