phpmyadmin connect to mysql probs.
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
$output = 'connected to the database server.';
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:
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'
Originally Posted by daihuws
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 09:50 AM.
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).
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
Glad to hear that you got it sorted.
Thank you. Here is my solution garnered from hours of searching.
For any other fellow newbies here is the whole fix:-
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)