RE: [PHP] php/mysql connection

From: Date: Mon, 03 Feb 2003 02:45:52 +0000
Subject: RE: [PHP] php/mysql connection
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-134079@lists.php.net to get a copy of this message
Because a default install of MySQL includes an anonymous user, one with no username or password. There is also a root user with no password. Read the MySQL manual on Installation and the GRANT command on how to fix this. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ > -----Original Message----- > From: Anthony Ritter [mailto:tony@gonefishingguideservice.com] > Sent: Sunday, February 02, 2003 3:16 PM > To: php-general@lists.php.net > Subject: [PHP] php/mysql connection > > Newbie question and OT. Sorry. > > I am able to conncet to a mysql server with the following call to > mysql_connect(). > $connect=@mysql_connect("","",""); > > There are no parameters in the function call. > > Why can I connect if there are no parameters? > > However, if I give mysqladmin the password of: > goodpassword > > and call: > > $connect=@mysql_connect("localhost","root","goodpassword"); > > I connect. > > But if I call: > $connect=@mysql_connect("localhost","root","badpassword"); > > I cannot connect. > > Or from the command line... > > >From the command line: > C:\Windows\cd c:\mysql\bin \\enter > > C:\mysql\bin> mysqld-shareware --standalone \\enter > > C:\mysql\bin> mysql \\enter note: no password have been entered. > > \\ I get the: Welcome to the MySql monitor... > ............................... > Or... > > C:\Windows\cd c:\mysql\bin \\enter > > C:\mysql\bin> mysqld-shareware --standalone \\enter > > C:\mysql\bin> mysql -u root - p \\ enter > > Enter password goodpassword \\ I get the: Welcome to the MySql monitor... > > > ............................ > C:\Windows\cd c:\mysql\bin \\enter > > C:\mysql\bin> mysqld-shareware --standalone \\enter > > C:\mysql\bin> mysql -u root - p \\ enter > Enter password badpassword \\ I do _not_ get the: Welcome to the MySql > monitor... > ........................ > > Why is this when I thought it needs a password to connect to the MySql > monitor? > Thanks, > TR > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#134079) next »