Jump to content

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

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.