Hi Alaister, Your root password is not actually set. If you do
mysql -u root -p<password> and it fails, it means that the password is not <password> if you do mysql -u root <password> the mysql client will parse <password> as the database you're trying to use -- that's just the syntax of the mysql client. Which means that your password is not very secure, because it's the same as your database name. You should get an error like this: ERROR 1049 (42000): Unknown database '<password>' What you should do is this: # mysql -u root > set password=password("<newpassword>"); where <newpassword> is your new password. hope this helps. -Sheeri On 10/27/05, Alastair Roy <[EMAIL PROTECTED]> wrote: > Thanks for your reply I think this is the issue I don't think root is > allowed to login from local host I created another user called web user and > changed the script, that works fine, next question is how do I set the > permissions for root in mysql to allow root to login, if I use > #mysql -u root <password> I go straight in > If I use > #mysql -u root -p > <password> > I get access denied for [EMAIL PROTECTED] > > -----Original Message----- > > Visit our websites: > > http://www.dailysnack.com +IBw-bite size news and gossip+IB0 > > http://www.express.co.uk The Worlds Greatest Newspaper > > http://www.dailystar.co.uk Simply The Best 7 Days A Week > > http://www.happymagazine.co.uk The One Stop Shopping Magazine > > http://www.ok.co.uk First For Celebrity News > > http://www.northernandshell.co.uk The Mark Of Excellence > > http://www.expresspictures.com Express Newspapers and OK Magazine online > picture archive > > > > > Also visit: > > The NMA: Opening Up Newspapers http://www.nmauk.co.uk > > ###2004### > ________________________________________ > Any views or opinions are solely those of the author > and do not necessarily represent those of Express Newspapers > ________________________________________ > The information transmitted is intended only for the person > or entity to which it is addressed and may contain confidential > and/or privileged material.If you are not the intended recipient > of this message please do not read ,copy, use or disclose this > communication and notify the sender immediately. It should be > noted that any review, retransmission, dissemination or other > use of, or taking action in reliance upon, this information by > persons or entities other than the intended recipient is prohibited. > E-mail communications may be monitored. > **************************************************************************** > > ##EXN2000## > > > From: sheeri kritzer [mailto:[EMAIL PROTECTED] > Sent: 25 October 2005 18:06 > To: Alastair Roy > Cc: mysql@lists.mysql.com > Subject: Re: PHP and mysql > > Yes. > > Whenever you have a problem, go back to basics. Can you login as root > on the commandline? What password do you use there? Once you're > there, check root's permissions, but I'd be willing to bet your > password is incorrect, or root is only allowed to logon from localhost > and not the machine the webserver is on. > > -Sheeri > > On 10/25/05, Alastair Roy <[EMAIL PROTECTED]> wrote: > > Greetings everyone, I am having a problem with PHP and mysql I have copied > a > > script exactly off a website to open the database and insert a new user I > > try to access the mysql database using the root user, and enter > information > > into the user table, this is the PHP I am using > > > > > > > > <? > > include 'library/config.php'; > > include 'library/opendb.php'; > > > > $query = "INSERT INTO user (host, user, password, select_priv, > insert_priv, > > update_ priv) ". > > "VALUES ('localhost', 'phpcake', PASSWORD('mypass'), 'Y', 'Y', > > 'Y')"; > > mysql_query($query) or die('Error, insert query failed'); > > > > $query = "FLUSH PRIVILEGES"; > > mysql_query($query) or die('Error, insert query failed'); > > > > include 'library/closedb.php'; > > ?> > > > > > > > > When I try this I get the access for user [EMAIL PROTECTED] host denied, it > > is > > driving me nuts no matter what I try I get the same thing other scripts I > > have tried do the same thing, have tried messing around with the > config.php > > and opendb.php included scripts but nothing works if I run php -f > opendb.php > > I get no errors which I think means it is working, then again I don't > know. > > > > > > > > Anyone have any ideas ?? > > > > > > > > Thanks in advance > > > > > > Visit our websites: > > > > http://www.dailysnack.com +IBw-bite size news and gossip+IB0 > > > > http://www.express.co.uk The Worlds Greatest Newspaper > > > > http://www.dailystar.co.uk Simply The Best 7 Days A Week > > > > http://www.happymagazine.co.uk The One Stop Shopping Magazine > > > > http://www.ok.co.uk First For Celebrity News > > > > http://www.northernandshell.co.uk The Mark Of Excellence > > > > http://www.expresspictures.com Express Newspapers and OK Magazine online > picture archive > > > > > > > > > > Also visit: > > > > The NMA: Opening Up Newspapers http://www.nmauk.co.uk > > > > ###2004### > > ________________________________________ > > Any views or opinions are solely those of the author > > and do not necessarily represent those of Express Newspapers > > ________________________________________ > > The information transmitted is intended only for the person > > or entity to which it is addressed and may contain confidential > > and/or privileged material.If you are not the intended recipient > > of this message please do not read ,copy, use or disclose this > > communication and notify the sender immediately. It should be > > noted that any review, retransmission, dissemination or other > > use of, or taking action in reliance upon, this information by > > persons or entities other than the intended recipient is prohibited. > > E-mail communications may be monitored. > > > **************************************************************************** > > > > ##EXN2000## > > > > > > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]