HELP! Connecting existing mySQL

Problems with the Windows version of XAMPP, questions, comments, and anything related.

HELP! Connecting existing mySQL

Postby emmsielu » 02. February 2010 16:43

Hello there,

I'm a complete novice when it comes to anything this seriously programming, so would really appreciate a bit of help with something.

I have all of the PHP files of a website and an export of the mySQL database (and details of the actual database itself), and after some searching aorund, found XAMPP to test it locally on my machine. I've installed everything, and XAMPP seems to be working great.

What I'd like a hand with, is how do I connect the files themselves to the actual database - how do I put it all back together again to actually view the website locally? Either how to re-create the database from the export I have and put this into XAMPP, or connect the PHP files with the original database through PHPmyAdmin.

I have no idea where to start at all, and have searched the forums here and googled, but to no avail!

Any help would be most welcome.

Posts: 1
Joined: 02. February 2010 16:07

Re: HELP! Connecting existing mySQL

Postby LooseCannon » 03. February 2010 13:55

Hello and welcome emmsielu.

Have a look into the following, with XAMPP running:
1. Using PHPmyAdmin, import the database
2. Somewhere in the php website files there'll be the login details; the website logs into (connects) to the database; it looks something like:
$DB_USERNAME = "auser"; // username for logging in to db ref $DB_DATABASENAME below
$DB_PASSWORD = "123abc"; // password for logging in to db ref $DB_DATABASENAME below
$DB_HOSTNAME = "localhost"; // server hosting db usually "localhost"
$DB_DATABASENAME = "theDatabaseName"; // the name of the website database you've just imported

PHPmyAdmin (or say, can be used to see/administer the username, password and databasename. However, as this is an existing site and database, I'd guess they have already been setup.

"... how do I connect the files themselves to the actual database ..." The php code does it for you when you browse the web pages, if the user/pswd info is correct.
User avatar
Posts: 162
Joined: 18. September 2007 12:07
Location: Hampshire, UK

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 73 guests