homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

can't access mysql through phpmyadmin
Using root user

 11:06 am on Nov 14, 2010 (gmt 0)


I just installed apache, php and mysql on windows 7.
I went into mysql through the commandline and I changed the root password. I can log into mysqladmin etc with this password.
However I cannot log into phpmyadmin with this root user and password.
Does anyone have any idea what I"m doing wrong?




 11:46 am on Nov 14, 2010 (gmt 0)

Hi there,

You changed the root user from the command line, have you altered the config file to allow access from the ui now? Realistically making changes like this should be done through the mysqladmin ui, them you can set up an account that isn't root.

Shouldn't use root as the access for your scripting.



 11:47 am on Nov 14, 2010 (gmt 0)

Well I fixed it. I'm not sure I completely understand though.
I was following instructions from a book and in the install of mysql it said to uncheck set security settings during the configuration. that is, don't set a new root password. Then it shows you to go in and manually set the password. The reasoning behind this is that apparently that mysql wizard doesn't make passwords that are completely compatible with php, the book said. So when I do this I get this "#2000 Cannot log in to the MySQL server error".

So finally I tried reconfiguring mysql with this wizard and I made a new root password. Now it works. I also saw an installation tutorial recommend this so it seems there is some disagreement as to whether this should be done. Does anyone know about this? I'm happy for now. It lets me progress.



 11:52 am on Nov 14, 2010 (gmt 0)

have you altered the config file to allow access from the ui now?

Are you talking about the config.inc.php file in phpmysqladmin?

I'm not sure how this works then. I changed the password in mysql.
Not in the mysql wizard. So what is the difference? Does it change something in a config file that phpmyadmin looks at?

When you say "mysqladmin ui" are you saying, in my case, phpmyadmin?



 6:41 pm on Nov 14, 2010 (gmt 0)

>>Are you talking about the config.inc.php file in phpmysqladmin?

Yes, there are some parameters in there that you need to sort out for you to have full 'admin' control over phpmyadmin.

The idea is that you leave root well alone, unless your savvy enough to understand what can be done through this user name (it has NO restrictions) and set yourself up an account that you use for your development work, which in essence can be a copy of root, with the exception that you revoke some privileges so that you can't do damage to the database with a couple of erroneous commands.

Good that you have it sorted now, if you have it configured correctly, you should see an admin welcome screen that prompts you for authorization, then once in you should have a warning saying some thing along the lines of "no root password set", though from the sounds of this book, you probably have already set one, in which case you will be fine, and ready to code some sites!

Just remember that setting root as default access for your scripts is a bad idea, whether it be a localhost setup or a host setup, always generate a separate account, and REGULARLY change the password for it too.



 8:53 pm on Nov 14, 2010 (gmt 0)

Thanks for that Matthew.
That was helpful posting.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved