rich11 Posted October 10, 2007 Share Posted October 10, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/ Share on other sites More sharing options...
jaimitoc30 Posted October 10, 2007 Share Posted October 10, 2007 After installing MySQL, are you able to run it from the command prompt? and execute SQL queries from the command prompt. Usually when you get those errors is because it is not detecting a database server in 'localhost' Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366206 Share on other sites More sharing options...
rich11 Posted October 10, 2007 Author Share Posted October 10, 2007 I am running the database from the mysql administrator... I can edit data create tables and everything.. How do you run mysql from the command prompt?? Rich Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366233 Share on other sites More sharing options...
trq Posted October 10, 2007 Share Posted October 10, 2007 I get a HTTP 500 Internal Server Error??? Turn off show freindly error messgaes in your browsers preferences. Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366238 Share on other sites More sharing options...
rich11 Posted October 10, 2007 Author Share Posted October 10, 2007 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?? Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366295 Share on other sites More sharing options...
trq Posted October 10, 2007 Share Posted October 10, 2007 Forget mysql admin. Open a command prompt and type... mysql -p can you login? Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366301 Share on other sites More sharing options...
rich11 Posted October 10, 2007 Author Share Posted October 10, 2007 Allright... I went to the C:\ and type mysql -p and got an error 'mysql' is notn reconized as an internal or external command, operable program or batch file. Rich Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366307 Share on other sites More sharing options...
~n[EO]n~ Posted October 10, 2007 Share Posted October 10, 2007 LOL... you should be in mySQL folder man suppose mysql is in C: drive then goto C:\mysql\bin> and then type mysql -p Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366315 Share on other sites More sharing options...
rich11 Posted October 10, 2007 Author Share Posted October 10, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366325 Share on other sites More sharing options...
rich11 Posted October 10, 2007 Author Share Posted October 10, 2007 So when I entered the password, it denied me access Quote Link to comment https://forums.phpfreaks.com/topic/72636-troubling-connecting-to-a-mysql-database/#findComment-366327 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.