Jump to content

Xampp - Can't connect to MySQL via Phpmyadmin


Recommended Posts

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
Share on other sites

You Bloody Genius!!!!!  :D

 

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.