Crazydave1990 Posted July 8, 2012 Share Posted July 8, 2012 Guys, I'm literally on the verge of tearing my hair out! I'm new to PHP, been practicing the syntax - I just can't connect my Php code to the MySQL server! It's driving me bonkers! <?php mysql_connect("localhost", "admin", "1admin") or die(mysql_error()); echo "Connected to MySQL<br />"; ?> (taken from here http://www.tizag.com/mysqlTutorial/mysqlconnection.php) I have typed that in (replacing the username/password info with my own), I have set-up new users with full authorisation in the phpmyadmin, I have also created an admin user, with the 1admin password, its definitely localhost. Heck, I even changed localhost to 127.0.0.1, username to root and password to nothing, still won't connect! literally keep getting HTML Error 404!!!! I have copied and pasted that code to the letter! Please guys, help! According to that tutorial website, what I'm doing should work, yet it's not? I can access my localhost via browser by typing either localhost or 127.0.0.1 =[ Link to comment https://forums.phpfreaks.com/topic/265395-xampp-cant-connect-to-mysql-via-phpmyadmin/ Share on other sites More sharing options...
Pikachu2000 Posted July 8, 2012 Share Posted July 8, 2012 You're getting an http error, not a MySQL error. The file doesn't exist in the location you're trying to call it from. What directory did you save the file in? Link to comment https://forums.phpfreaks.com/topic/265395-xampp-cant-connect-to-mysql-via-phpmyadmin/#findComment-1360150 Share on other sites More sharing options...
Crazydave1990 Posted July 8, 2012 Author Share Posted July 8, 2012 You Bloody Genius!!!!! Thank you! I installed SQL on my other PC, didn't realize I wasn't saving my stuff in the xampp folder, checked that! Boom! soon as I pressed f5, worked! Thanks man, a prime case of checking the simple stuff first. Thanks! Link to comment https://forums.phpfreaks.com/topic/265395-xampp-cant-connect-to-mysql-via-phpmyadmin/#findComment-1360152 Share on other sites More sharing options...
Pikachu2000 Posted July 8, 2012 Share Posted July 8, 2012 Well then, there you have it Link to comment https://forums.phpfreaks.com/topic/265395-xampp-cant-connect-to-mysql-via-phpmyadmin/#findComment-1360153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.