Re: [PHP-DB] MySQL Connect Problem
If this is the case, you need to check the rights that your id jeff has. It should be in the mysql database under the tablename user. You have to make sure that you have all the rights, all the priviliges equals to 'Y'. I'm not really sure how these previiliges, but you can just set everything to 'Y' for the time being, until you find what each and single one of those priviliges will do. Do you have still have the root id? Have you tried to connect using the root id? If the command line is a hassle to you might want to try and download mysqlfront from www.mysqlfront.de Jeff Oien wrote: I tried your code and got this: Warning: Can't connect to MySQL server on 'localhost' Also tried ip address of my machine. So at least maybe that narrows down the problem. Jeff Oien Hi Jeff, I am using Windows, but am a beginner. Here is some code I use maybe it will help I use this in my navigation pages: ? include (db_details.php); ? ? mysql_pconnect($host,$user,$password) or die(Unable to connect to SQL server); mysql_select_db($dbasename) or die(Unable to select database); ? and here is db_details.php ? $host=host.name.com; $user=user_id; $password=password; $dbasename=database_name; ? By using the include it means if I go LIVE with a site I only have to change one file db_details.php The reason I don't do it all in one is that it didn't like . in IP addresses for some reason ( I think it thought it was the beginning of a string) On my windows machine my db_details would look like this ? $host=localhost; $user=; $password=; $dbasename=database_name; ? You shouldn't need a password. I hope this helps All the Best Lisa -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:16 PM To: PHP-DB Subject: RE: [PHP-DB] MySQL Connect Problem I'm on Windows 2000. Jeff Jeff, If you are on unix/linux use the command id to see who you are. You can only use jeff in your connect string if jeff is a user in your mysql database. If you are root when you are running mysql then you should probably set a password for root in the database. Wayne On Thu, 17 May 2001 13:20, Jeff Oien wrote: Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien Are your the 'root' rather than 'jeff'? Did you alter the grants and apply the password? If not do you need a password for connection? Tim Morris To be honest I don't know if I am root. I know I don't need a password to connect via the command line. I just type 'mysql'. I do have username and password specified in the .ini file which I believe I set when I first installed it. What can I do from here? Jeff Oien -- Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231 Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686 Running Windows on a Pentium is like having a brand new Porsche but only be able to drive backwards with the handbrake on. (Unknown source) == This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the NSW Department of Health. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL Connect Problem
Where you have your variable set to password just put that means there is no password other whys your saying your password is password Jeff Oien [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I tried your code and got this: Warning: Can't connect to MySQL server on 'localhost' Also tried ip address of my machine. So at least maybe that narrows down the problem. Jeff Oien Hi Jeff, I am using Windows, but am a beginner. Here is some code I use maybe it will help I use this in my navigation pages: ? include (db_details.php); ? ? mysql_pconnect($host,$user,$password) or die(Unable to connect to SQL server); mysql_select_db($dbasename) or die(Unable to select database); ? and here is db_details.php ? $host=host.name.com; $user=user_id; $password=password; $dbasename=database_name; ? By using the include it means if I go LIVE with a site I only have to change one file db_details.php The reason I don't do it all in one is that it didn't like . in IP addresses for some reason ( I think it thought it was the beginning of a string) On my windows machine my db_details would look like this ? $host=localhost; $user=; $password=; $dbasename=database_name; ? You shouldn't need a password. I hope this helps All the Best Lisa -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:16 PM To: PHP-DB Subject: RE: [PHP-DB] MySQL Connect Problem I'm on Windows 2000. Jeff Jeff, If you are on unix/linux use the command id to see who you are. You can only use jeff in your connect string if jeff is a user in your mysql database. If you are root when you are running mysql then you should probably set a password for root in the database. Wayne On Thu, 17 May 2001 13:20, Jeff Oien wrote: Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien Are your the 'root' rather than 'jeff'? Did you alter the grants and apply the password? If not do you need a password for connection? Tim Morris To be honest I don't know if I am root. I know I don't need a password to connect via the command line. I just type 'mysql'. I do have username and password specified in the .ini file which I believe I set when I first installed it. What can I do from here? Jeff Oien -- Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231 Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686 Running Windows on a Pentium is like having a brand new Porsche but only be able to drive backwards with the handbrake on. (Unknown source) == This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the NSW Department of Health. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
Hi Jeff, I am using Windows, but am a beginner. Here is some code I use maybe it will help I use this in my navigation pages: ? include (db_details.php); ? ? mysql_pconnect($host,$user,$password) or die(Unable to connect to SQL server); mysql_select_db($dbasename) or die(Unable to select database); ? and here is db_details.php ? $host=host.name.com; $user=user_id; $password=password; $dbasename=database_name; ? By using the include it means if I go LIVE with a site I only have to change one file db_details.php The reason I don't do it all in one is that it didn't like . in IP addresses for some reason ( I think it thought it was the beginning of a string) On my windows machine my db_details would look like this ? $host=localhost; $user=; $password=; $dbasename=database_name; ? You shouldn't need a password. I hope this helps All the Best Lisa -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:16 PM To: PHP-DB Subject: RE: [PHP-DB] MySQL Connect Problem I'm on Windows 2000. Jeff Jeff, If you are on unix/linux use the command id to see who you are. You can only use jeff in your connect string if jeff is a user in your mysql database. If you are root when you are running mysql then you should probably set a password for root in the database. Wayne On Thu, 17 May 2001 13:20, Jeff Oien wrote: Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien Are your the 'root' rather than 'jeff'? Did you alter the grants and apply the password? If not do you need a password for connection? Tim Morris To be honest I don't know if I am root. I know I don't need a password to connect via the command line. I just type 'mysql'. I do have username and password specified in the .ini file which I believe I set when I first installed it. What can I do from here? Jeff Oien -- Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231 Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686 Running Windows on a Pentium is like having a brand new Porsche but only be able to drive backwards with the handbrake on. (Unknown source) == This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the NSW Department of Health. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
I tried your code and got this: Warning: Can't connect to MySQL server on 'localhost' Also tried ip address of my machine. So at least maybe that narrows down the problem. Jeff Oien Hi Jeff, I am using Windows, but am a beginner. Here is some code I use maybe it will help I use this in my navigation pages: ? include (db_details.php); ? ? mysql_pconnect($host,$user,$password) or die(Unable to connect to SQL server); mysql_select_db($dbasename) or die(Unable to select database); ? and here is db_details.php ? $host=host.name.com; $user=user_id; $password=password; $dbasename=database_name; ? By using the include it means if I go LIVE with a site I only have to change one file db_details.php The reason I don't do it all in one is that it didn't like . in IP addresses for some reason ( I think it thought it was the beginning of a string) On my windows machine my db_details would look like this ? $host=localhost; $user=; $password=; $dbasename=database_name; ? You shouldn't need a password. I hope this helps All the Best Lisa -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 17, 2001 2:16 PM To: PHP-DB Subject: RE: [PHP-DB] MySQL Connect Problem I'm on Windows 2000. Jeff Jeff, If you are on unix/linux use the command id to see who you are. You can only use jeff in your connect string if jeff is a user in your mysql database. If you are root when you are running mysql then you should probably set a password for root in the database. Wayne On Thu, 17 May 2001 13:20, Jeff Oien wrote: Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien Are your the 'root' rather than 'jeff'? Did you alter the grants and apply the password? If not do you need a password for connection? Tim Morris To be honest I don't know if I am root. I know I don't need a password to connect via the command line. I just type 'mysql'. I do have username and password specified in the .ini file which I believe I set when I first installed it. What can I do from here? Jeff Oien -- Wayne Bastow - DBA - Central Coast Health Phone: 61 2 43203231 Email: wbastowATccahsDOThealthDOTnswDOTgovDOTau Linux, the choice of a GNU generation Kernel 2.2.16-22 on a i686 Running Windows on a Pentium is like having a brand new Porsche but only be able to drive backwards with the handbrake on. (Unknown source) == This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily the views of the NSW Department of Health. == -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
Used Prompt in Win2k. Moved to the apache/mysql/bin directory and typed mysql. Jeff Oien You said you could connect through the command-line. How did you do that? Jonathan Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien 1. Can you set up a simple connection for us to test out? Allow people from any host (%) to connect. 2. Try connecting to your own IP address or host name instead of localhost. They SHOULD mean the same thing, but I've been able to connect to IP addresses and not localhost's before when dealing with Windows 2k and mySQL. It's almost as if my install of mySQL had set up its own name of something else. Very weird, but its worth a shot. -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 8:24 PM To: PHP-DB Subject: RE: [PHP-DB] MySQL Connect Problem Yes they are. Jeff Is the MySQL and Apache running on the same machine? Jeff Oien wrote: I have MySQL on a new Win2000 install and can't connect to it using PHP. I am able to connect using the command line. I'm not sure what the next step is to troubleshoot. I've checked the username and password in the .ini file using WinMySQLAdmin. I'm using Apache which is working fine otherwise. Typical code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
Yes it is running. I don't need to use a password when running from the command line but I am when connecting through PHP. This is exactly how I did it on my Win98 machine but it isn't working with W2k. Jeff Oien Well the mysql tool doesn't need any authentication usually when you first set it up. Is the winmysqladmin tool running in your system tray? You should see a stop light with the green light lighted up. Jonathan Used Prompt in Win2k. Moved to the apache/mysql/bin directory and typed mysql. Jeff Oien You said you could connect through the command-line. How did you do that? Jonathan Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien 1. Can you set up a simple connection for us to test out? Allow people from any host (%) to connect. 2. Try connecting to your own IP address or host name instead of localhost. They SHOULD mean the same thing, but I've been able to connect to IP addresses and not localhost's before when dealing with Windows 2k and mySQL. It's almost as if my install of mySQL had set up its own name of something else. Very weird, but its worth a shot. -Original Message- From: Jeff Oien [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 15, 2001 8:24 PM To: PHP-DB Subject: RE: [PHP-DB] MySQL Connect Problem Yes they are. Jeff Is the MySQL and Apache running on the same machine? Jeff Oien wrote: I have MySQL on a new Win2000 install and can't connect to it using PHP. I am able to connect using the command line. I'm not sure what the next step is to troubleshoot. I've checked the username and password in the .ini file using WinMySQLAdmin. I'm using Apache which is working fine otherwise. Typical code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL Connect Problem
Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien Are your the 'root' rather than 'jeff'? Did you alter the grants and apply the password? If not do you need a password for connection? Tim Morris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
Here is sample code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? This is on my machine only used by me. I also tried connecting to IP address and 127.0.0.1 and it still won't work. Thanks. Jeff Oien Are your the 'root' rather than 'jeff'? Did you alter the grants and apply the password? If not do you need a password for connection? Tim Morris To be honest I don't know if I am root. I know I don't need a password to connect via the command line. I just type 'mysql'. I do have username and password specified in the .ini file which I believe I set when I first installed it. What can I do from here? Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] MySQL Connect Problem
Is the MySQL and Apache running on the same machine? Jeff Oien wrote: I have MySQL on a new Win2000 install and can't connect to it using PHP. I am able to connect using the command line. I'm not sure what the next step is to troubleshoot. I've checked the username and password in the .ini file using WinMySQLAdmin. I'm using Apache which is working fine otherwise. Typical code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] MySQL Connect Problem
Yes they are. Jeff Is the MySQL and Apache running on the same machine? Jeff Oien wrote: I have MySQL on a new Win2000 install and can't connect to it using PHP. I am able to connect using the command line. I'm not sure what the next step is to troubleshoot. I've checked the username and password in the .ini file using WinMySQLAdmin. I'm using Apache which is working fine otherwise. Typical code: ? $connection = @mysql_connect(localhost, jeff, *) or die(Couldn't connect.); if ($connection) { $msg = success!; } ? Thanks. Jeff Oien -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]