Mattingly23 Posted December 13, 2003 Share Posted December 13, 2003 Hi, I\'m new to php. I set up a localhost server on my computer, and I\'m trying to use phpMyAdmin with mySql. When I run phpMyAdmin, I get a message at the bottom of the site: Your configuration file contains settings (root with no password) that correspond to the default MySQL privileged account. Your MySQL server is running with this default, is open to intrusion, and you really should fix this security hole. It seems like I can still work on everything ok, although I haven\'t tried because I\'m not sure what I\'m doing yet. I thought I set up a password for mySQL using mySQLAdmin. I put these in the config file for myPHPAdmin, but then it said I couldn\'t log on. Is this a problem if I\'m working just on my computer? What if I upload my files to a host that supports php, will this problem still be there? If it is a problem, how do I fix it? Thank you for your help. Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/ Share on other sites More sharing options...
gizmola Posted December 13, 2003 Share Posted December 13, 2003 Well you either have a mysql password for the root account or you don\'t. If you don\'t you need to set one, which is what the phpmyadmin message is warning you about. Once you login to mysqladmin you should use the mysql database. Then issue this query to change your root password (in the phpmyadmin sql window): UPDATE user SET Password=PASSWORD(\'somenewpw\') WHERE user=\'root\' Once that query completes, issue this command: FLUSH PRIVILEGES; Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/#findComment-4929 Share on other sites More sharing options...
gizmola Posted December 13, 2003 Share Posted December 13, 2003 It\'s also a good thing to create one or more users and associate them with individual databases for the purposes of developing scripts or using your own script. This command let\'s you create a new user and give that user permissions to use a database called test_db you created with the command CREATE DATABASE test_db: GRANT ALL ON test_db.* TO testusr@localhost IDENTIFIED BY \"testusrpw\"; Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/#findComment-4930 Share on other sites More sharing options...
Mattingly23 Posted December 14, 2003 Author Share Posted December 14, 2003 But does this even matter if security is not an issue on my home computer and I will eventually upload the site to a server? Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/#findComment-4933 Share on other sites More sharing options...
gizmola Posted December 14, 2003 Share Posted December 14, 2003 I think it matters if someone found your phpmyadmin page, and was able to go into mysql as root because you had no password. From there it\'s quite easy to do a lot of nasty things to not only your database but to the system itself since mysql has the ability to read/write file system files. Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/#findComment-4935 Share on other sites More sharing options...
weeie Posted December 14, 2003 Share Posted December 14, 2003 Well you either have a mysql password for the root account or you don\'t. If you don\'t you need to set one, which is what the phpmyadmin message is warning you about. Once you login to mysqladmin you should use the mysql database. Then issue this query to change your root password (in the phpmyadmin sql window): UPDATE user SET Password=PASSWORD(\'somenewpw\') WHERE user=\'root\' Once that query completes, issue this command: FLUSH PRIVILEGES; i\'ve just installed mysql and followed your instructions to change the root password as shown above. After i changed the password, i can\'t seem to be able to login to phpmyadmin after a refresh(F5) with the error: \"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server. Error MySQL said: #1045 - Access denied for user: \'root\'@\'localhost\' (Using password: NO)\" the server is up running and i am able to login to mysql query through the windows command prompt by C:mysqlbin>mysql -u root -p , and then the new password. So i tried to change these settings in config.inc as shown below: $cfg[\'Servers\'][$i][\'auth_type\'] = \'config\'; $cfg[\'Servers\'][$i][\'user\'] = \'root\'; $cfg[\'Servers\'][$i][\'password\'] = \'newpasswordhere\'; And then i got a different error as shown below: \"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server. Error MySQL said: #1250 - Client does not support authentication protocol requested by server; consider upgrading MySQL client [Documentation]\" The only problem is that i can\'t login to phpmyadmin. Can you or someone help please? My computer: OS windows 2000 MySQL 4.1.1alpha-nt Apache 2.0.48 PHP 4.31 My sql.user: +-----------+------+-------------------------------------------+-------- ---------+---------------+--------------+-----------+------------+------ -----------+------------------+--------------+-----------------+-------- -+-------------+-----------------+ | localhost | root | *38BD01F782C3A573921C98F969FAE38DD3780B8E | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 0 | 0 | | % | root | *38BD01F782C3A573921C98F969FAE38DD3780B8E | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y | 0 | 0 | | localhost | | | N | N | N | N | N | N | N | N | N | N | 0 | 0 | | % | | | N | N | N | N | N | N | N | N | N | N | 0 | 0 | +-----------+------+-------------------------------------------+-------- ---------+---------------+--------------+-----------+------------+------ -----------+------------------+--------------+-----------------+-------- -+-------------+-----------------+ I would appreciate it a lot if someone could help me with this. Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/#findComment-4938 Share on other sites More sharing options...
weeie Posted December 15, 2003 Share Posted December 15, 2003 i\'ve solved my problem! The problem lies with connecting to 4.1 mysql server with 4.0 mysql client. More info: http://www.mysql.com/doc/en/Password_hashing.html Quote Link to comment https://forums.phpfreaks.com/topic/1495-phpmyadmin-root-with-no-password-problem/#findComment-4947 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.