Jump to content

Can't even connect to phpMyAdmin!! MySql says "Cannot connect: invalid settings"


stevieontario

Recommended Posts

Afternoon Freaks,

 

I'm having a weird experience trying to insert data to a Mysql db using php.

 

I'm getting the following message:

 

"Warning: mysql_connect() [function.mysql-connect]: Access denied for user'myname'@'localhost' (using password: YES)"

 

Playing in a xampp sandbox and editing/launching code from DreamWeaver CS3

PHP v. 5.2.9

MySQL API 5.0.51a

 

My code:

	$db_hostname = "localhost";
$db_name = "mydb";
$db_username = "myname";
$db_password = "mypassword";
$cxn = mysql_connect($db_hostname, $db_username, $db_password);
///////////////////////////////////////////////////////////////////////////////////////////////////////

$insert2sourceinfo2 =	"insert into sourceinfo2
					(filename, filedate, version, generated)
					VALUES ('$filename', '$fdate', '$fversion', '$generated_date')";
					mysql_query($insert2sourceinfo2, $cxn);
$lastSid = mysql_insert_id();

 

I set up xampp on a machine I don't normally use it on (the one I normally use is kaput for the time being), and as far as I can remember all the settings (db host, db name, etc.) are exactly the same.

 

If anyone has any ideas where the little gremlin is, I'd sure appreciate it!

 

Thanks,

 

Link to comment
Share on other sites

have you checked to make sure that the user exists in the "mysql" DB in the users table with the appropriate rights?

 

By default xammp is installed with user root and no password, have you created a new user with a password?

 

i use xampp and wamp, so if you need help setting it up let me know. with xampp there is a doc you can open that will allow you to adjust the security settings (add a password ect to the root account in mysql) i woudl sugest doing this first. if i remember correctly as i am at work and not at home if you goto http://localhost it will take you through the steps (do this from fresh install)

Link to comment
Share on other sites

Jay, many thanks. I'll try that doc you recommended.

 

However, in attempting to work through the problem outlined in my post, I ran into the problem indicated in the Subject. i.e., I went and changed the local password (in phpMyAdmin), and now I can't even load the local page in my browser without getting the following error message:

 

Cannot connect: invalid setting

 

I have googled the heck out of this, and keep running into suggestions that I reset privileges via the command line prompt. It is at that point that I realize I'm in way over my head: I don't even know how to access mysql from the command line prompt. In fact I'm not even sure what the command line prompt is!

Link to comment
Share on other sites

I'm playing whack-a-mole here. I uninstalled xampp, and reinstalled it only to get (1) a warning that

install\xampp_xampp.php: failed to open stream: no such file or directory in C:\Program Files\setup_xampp.bat on line 33

 

and (2) a fatal error:

require (): Failed opening required 'C:\Program Files\install\xampp_xampp.php' (include_path='.;.\pear in C:\Program Files\setup_xampp.bat on line 33

 

Yikes! Any ideas on what's going on?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • Create New...

Important Information

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.