hjf Posted June 5, 2008 Report Share Posted June 5, 2008 I am trying to access MySQL using PHP. I get an error message stating access is denied for user '-uroot'@'localhost'. The '-uroot' and '-proot' worked fine in the MySQL console. Are they different if I'm accessing MySQL using PHP? Here's the part of the code where I put in username and password: <?php /* Program: mysql_up.php * Desc: Connects to MySQL Server and * outputs settings. */ echo "<html> <head><title>Test MySQL</title></head> <body>"; $host="localhost"; $user="-uroot"; $password="-proot"; $cxn = mysqli_connect($host,$user,$password); $sql="SHOW STATUS"; $result = mysqli_query($cxn,$sql); if($result == false) Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.