Jump to content

Recommended Posts

Hello, I had my website working perfectly untill i realised i can access PHPmyadmin from anywhere, so ive added a password to XAMPP (127.0.0.1/xampp) and ive added a password for the mysql database...

 

i have all the correct settings on my connect script.. but i get this error..

 

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in C:\xampp\htdocs\SW\Soldiers Warfare\main\connection.php on line 11

 

it says using password: NO..but i have got a password there!

Link to comment
https://forums.phpfreaks.com/topic/183431-connecting-to-mysql-with-a-password/
Share on other sites

hmm, well ive removed password at the moment so i can keep on making my site....

 

here is the connection process:

 

$host="localhost";
$username="root";
$password="";
$db_name="site";


//connect to database
mysql_connect("$host","$username","$password")or die("cannot connect to server");
mysql_select_db("$db_name")or die("cannot select Database");

 

If i set the phpmyadmin password as 'test'..what o i do to this code ( i asumed i put it in the password variable but its not working...)

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.