Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 can't connect to database
Google
Post new topic Reply to topic
Author Message
chryss
 
 


Joined: 28 May 2007
Posts: 1

PostPosted: Wed May 30, 2007 7:33 am Reply with quoteBack to top

Hello. I've finished installing the apache2triad 1.5.4.exe. My problem is I can't connect to database MySql. What's the problem?
View user's profileSend private message
invisible-root
 
 


Joined: 01 Jun 2007
Posts: 7

PostPosted: Fri Jun 01, 2007 8:08 am Reply with quoteBack to top

To connect to mySQL you must use your login information. If you want to connect to mySQL using php, you can do it with the following file:

Code:

<?php

$db_host = 'localhost'; // enter the host here; usually localhost
$db_user = 'root'; // your username here
$db_pass = 'pass'; // your password here
$db_name = 'your_db'; // the db name you wish to connect to

if (!mysql_connect($db_host, $db_user, $db_pass))
{
   die("Could not connect to SQL Server: " . mysql_error());
}

if (!mysql_select_db($db_name))
{
  die("Could not select DB: " . mysql_error());
}

?>


If you've forgot your login information you can reset mySQL root password.

Cheers.

PS: I assume SQL is running on your server, isn't it?
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT