Jump to content

Troubling connecting to a MYSQL Database


rich11

Recommended Posts

Hello...

 

I have installed PHP and mySQL...  and followed the instructions to a T...    PHP i know works.. I mysql seem to instal fine...  but when I run some PHP to see if it will connect to the mysql database I get a  HTTP 500 Internal Server Error??? 

 

here is the connection code

 

<?PHP

//remember to change the password to whatever you set

//it to in mysql instance configuration

 

//first parameter is server name, 2nd username 'root', 3rd is password

$rst = @mysql_connect("localhost","root","webmaster");

 

if (!$rst){

      echo( "<p>Unable to connect to database manager.</p>");

      die('Could not connect: ' . mysql_error());

      exit();

} else {

  echo("<p>Successfully Connected to MySQL Database Manager!</p>");

}

 

if (! @mysql_select_db("mysql") ){

      echo( "<p>Unable to  connect database...</p>");

      exit();

} else {

  echo("<p>Successfully Connected to Database 'MYSQL'!</p>");

}

?>

 

Does anyone know what is going on??

 

thx

 

RIch

Link to comment
https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/
Share on other sites

Ok..  sorry about this.. I just tried to create a table in mysql admin.. and got an error...

 

MySQL Error Number 1289

The "innodb" feature is disabled, you need mysql built with "innoDB" to have it working.

 

 

Maybe this is part of my problem??

Ok...  a few things...

 

Mine isn't located under C:\mysql\bin

 

It is located

 

C:\program files\mysql\mysql server 5.0\bin\

 

So when I type msql -p  it asked for a password and I type it in....  but I noticed it was trying to use the username as  ODBC@localhost instead of the username root.

 

Rich

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.