Hi. I've installed wamp on windows 7 successfully and opened mysql console. i changed the password and created a database. each time i open the console and give my password it is fine. I then went to phpmyadmin in the wamp and it comes up with error saying cannot connect to mysql using localhost, root, password (NO). How is it that I can connect using a php script function:
$link = mysqli_connect('localhost', 'root', 'myPassword'); //(myPassword is not the password obviously
if ($link)
{
$output = 'connected to the database server.';
include 'output.html.php';
exit();
does phpmyadmin have a config where I have to put in my password?
i'm very confused
thanks for looking and thanks for an answer
Hi! I've not used PHPMyAdmin for some time, but I've got a feeling that it may not allow root login from the web interface as a security feature; try creating a non-root user, giving it appropriate privileges on the database, and then see if you can log into PHPMyAdmin using your new non-root user.
Syntax would be something along the lines of:
Code:
CREATE USER 'lenny'@'localhost' IDENTIFIED BY 'password1';
GRANT ALL ON mydatabase.* TO 'lenny'@'localhost';
Hi! I've not used PHPMyAdmin for some time, but I've got a feeling that it may not allow root login from the web interface as a security feature; try creating a non-root user, giving it appropriate privileges on the database, and then see if you can log into PHPMyAdmin using your new non-root user.
Syntax would be something along the lines of:
Code:
CREATE USER 'lenny'@'localhost' IDENTIFIED BY 'password1';
GRANT ALL ON mydatabase.* TO 'lenny'@'localhost';
hi daihuws, i take it that i should use a different password than the root password ie; indentified by 'whateverpassword'
I edited the config.inc.php to password='mypassword' which merely changes error to using password YES. i also changed the port to 3306. server is localhost user=root. if i create user lenny i suppose i should change that in the config.inc.php file also?
Last edited by LennyOneStep; 08-25-2012 at 08:50 AM.
Reason: clarification
I don't have access to a PHPMyAdmin config file at the moment, but I have always set the 'auth_type' config setting to 'cookie', which will then display a login screen whenever you start a new PHPMyAdmin session, allowing you to log in with whichever defined MySQL user you want to use (including root).
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
Hi NogDog
I have solved the problem! only took six hours!
I had to reset password in the mysql console
big sigh of relief! i will post solution shortly.
thanks for help and interest
Thank you. Here is my solution garnered from hours of searching.
For any other fellow newbies here is the whole fix:-
mysql>UPDATE mysql.user
->SET Password=PASSWORD("*******")
->WHERE User="root";
mysql>FLUSH PRIVILEGES;
This is from Sitepoint's "Build your own Database Driven Website using PHP and MYSQL"
And then as Longneck said specify the password in the config.inc.php file for phpmyadmin.
Bookmarks