I am trying to get started with MySQL. I installed the software this morning however whenever I try and view a MySQL page on the server I always get the following error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/users/2014/21244429/public_html/IT Assignment 2B/cart.php on line 7
Access denied for user 'root'@'localhost' (using password: YES)
How can I get around this? Ive been searching for hours now to find a solution but nothing has helped. When installing MySQL I did set up a password and when I go into the installer this password is accepted when checking if root privileges.
Here is the code I am trying to display:
<?php
session_start();
$page = 'index.php';
mysql_connect('localhost','root','password') or die(mysql_error());
mysql_select_db('cart') or die(mysql_error());
echo "Done!"
?>