title: ACCESS DENIED ROOT@LOCALHOST USING PASSWORD YES
body: <p>I know very little about programming, which means that whatever I learned, I learned it from youtube. So in order to explain my problem I am writing everything, so when I get a reply I can understand it.</p>
  
  <p>First I tried to download Apache, MySQL and phpMyAdmin but did not succeed.</p>
  
  <p>After that I downloaded XAMPP 1.7.7</p>
  
  <p>In XAMPP 1.7.7 I gave this information for my security.</p>
  
  <p><strong>MYSQL SECTION: "ROOT" PASSWORD (This line was already there as a heading)</strong> 
  <strong>MYSQL super user : root (it was already there so i can't change it)</strong>
  password : bluebus
  PhpMyAdmin authentification: http or cokie (I selected cokie)
  Safe plain password in text file? ((File: C:\xampp\security\security\mysqlrootpasswd.txt): there was a check box I did not click.</p>
  
  <p><strong>XAMPP DIRECTORY PROTECTION (.htaccess) (this line was already there as a heading)</strong></p>
  
  <p>User: bus
  Password : bluebuss
  Safe plain password in text file? ((File: C:\xampp\security\security\mysqlrootpasswd.txt): there was a check box I did not click.</p>
  
  <p><em>AFTER THAT I WENT TO PHPMYADMIN</em>
  user : root
  password: redbus</p>
  
  <p>I created a database, DATABASE NAME: CAR
  I added a new user for this database, NEW USER NAME: CAR, and password I gave again <strong>"redbus"</strong>, and I created a table</p>
  
  <p>Then I created a new file in notepad++, the code is </p>
  
  <pre><code>&lt;?php
  
  define ('DB_NAME', 'car');
  define ('DB_USER', 'car');
  define ('DB_PASWORD', 'redbus');
  define ('DB_HOST', 'localhost');
  
  $link= mysql_connect (DB_HOST,DB_USER,DB_PASSWORD);
  
  if (!$link) {
  die ('could not connect:' . mysql_error () );
  }
  
  $db_selected=mysql_selected_db (DB_NAME, $link);
  
  if (!$db_selected) {
  die ('cant user' . ':' . mysql_error ());
  }
  
  $value = $_post ['input1'];
  
  $sql= "INSERT INTO demo (input1) VALUES ('$value')";
  
  if (!mysql_query ($sql)) {
  die ('error:' . mysql_error () );
  }
  
  mysql_close ();
  ?&gt;
  </code></pre>
  
  <p>When i tried to run it, it gave me this error, and I don't understand why:</p>
  
  <p><code>**Notice:** *Use of undefined constant DB_PASSWORD - assumed 'DB_PASSWORD' in C:\xampp\htdocs\PhpProject1\index.php on line 8*</code></p>
  
  <p><code>**[Warning:** *mysql_connect() [function.mysql-connect]: Access denied for user 'car'@'localhost' (using password: YES) in C:\xampp\htdocs\PhpProject1\index.php on line 8*</code></p>
  
  <p><code>Could not connect: Access denied for user 'malakiarif'@'localhost' (using password: YES)</code></p>
  
  <p>Please help me guys, I tried to find out the answer by googling and wasted my whole week but could not find an answer.</p>
  
  <p>thanks</p>