suttercain Posted February 20, 2007 Share Posted February 20, 2007 Hello, I am trying to connect to my localhost (c drive) using the mysqli function. Since I am using WAMP there is no password for mysql. <?php $conn = new mysqli ('localhost', 'root', 'dbname'); ?> I get the following error: Warning: mysqli::mysqli() [function.mysqli-mysqli]: (28000/1045): Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\PHP\test.php on line 2 How do I let it know that no password is required? Thanks. Link to comment https://forums.phpfreaks.com/topic/39342-solvedconnect-via-mysqli-on-localhost-using-wamp-with-no-password/ Share on other sites More sharing options...
Balmung-San Posted February 20, 2007 Share Posted February 20, 2007 $cond = new mysqli('localhost', 'root', NULL, 'dbname'); Always remember that order of arguments does matter, even if the arguments are optional. Link to comment https://forums.phpfreaks.com/topic/39342-solvedconnect-via-mysqli-on-localhost-using-wamp-with-no-password/#findComment-189732 Share on other sites More sharing options...
suttercain Posted February 20, 2007 Author Share Posted February 20, 2007 Thank you Link to comment https://forums.phpfreaks.com/topic/39342-solvedconnect-via-mysqli-on-localhost-using-wamp-with-no-password/#findComment-189733 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.