Re: PHP mysql_connect Access Denied

From: Date: Mon, 19 Mar 2001 21:17:35 +0000
Subject: Re: PHP mysql_connect Access Denied
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-7611@lists.php.net to get a copy of this message
http://mysql.com/documentation/mysql/bychapter/manual_Privilege_system.html# Adding_users Check out the docs here. You need to add users this way: shell> mysql --user=root mysql mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO monty@"%" IDENTIFIED BY 'some_pass' WITH GRANT OPTION; mysql> GRANT RELOAD,PROCESS ON *.* TO admin@localhost; mysql> GRANT USAGE ON *.* TO dummy@localhost; olinux ----- Original Message ----- From: "Matt Coyne" <m@threezero.co.uk> To: <php-db@lists.php.net> Sent: Monday, March 19, 2001 8:16 AM Subject: [PHP-DB] PHP mysql_connect Access Denied > Hi > > Newbie here > > I am running Apache/PHP/MySQL locally which emulates my server environment > online. I want to use it as a test environment. > > I am running through Julie Meloni's 'PHP Fast & Easy...' and have run up > against a problem. > > Using the mysql_connect statement in a php page: > > <? > $connection=mysql_connect("localhost", "threezero", "qwerty00") > or die > ("could not connect"); > > if ($connection) { > $msg = "success"; > } > > ?> > <html> > <head> > <title>MySQL Connection</title> > </head> > <body bgcolor="#FFFFFF" text="#000000"> > > <? echo "$msg"; ?> > > </body> > </html> > > I get the following error returned in any browser: > > Warning: MySQL Connection Failed: Can't connect to MySQL server on > 'localhost' (10061) in c:\program files\apache > group\apache\htdocs\threezero\phptests\dbstuff\db_connect.php on line 2 > could not connect > > This is returned after enetering the following into the 'mysql' database > using the MySQL monitor: > > insert into user (host, user, password) values ('localhost', 'threezero', > password('qwerty00'); > > Querying the table returns the inserted values in the table (the password > column being encrypted). > > I am thinking that there are some potential configuration problems as the > php page works in my online server environment (pair networks) > > Has anyone got an idea where I am going wrong and/or can point me in the > right direction? > > Any help appreciated. > > TIA > Matt Coyne > > > t h r e e z e r o : : : > > the mill, millstone lane, leicester, le1 5jn > e : m@threezero.co.uk :: m : 07747 845690 > w : http://www.threezero.co.uk > > : : : t h r e e z e r o > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

« previous php.db (#7611) next »