nilson Posted November 28, 2003 Share Posted November 28, 2003 I've been having this problem since mid-2002. I have MySQL, and it always denies access, no matter what username/password I use, nor what version I use. There's one exception, well, two: 4.0.5 or something worked and 4.0.13 worked. I'm on Windows XP, and this problem has spanned two machines. I've deleted my my.ini file, and every bit of MySQL in existance on the computer, but it just won't work. The interface shows that the server is runnning, but it's not accepting connections apparently... This is seriously hendering my PHP development, and I need to get it working now.Has anyone else encountered this and/or know what I can do?P.S. I'm sticking with MySQL; Postgres or MS is not an option. Quote Link to comment Share on other sites More sharing options...
Peachy Posted November 28, 2003 Share Posted November 28, 2003 Nilson,MySQL installs with no password for the default administrator account, which is named 'root'. So the first thing you need to do after installation is login from the console with the command:mysql -u rootYou should then see the mysql monitor prompt mysql>To create a user you need to type a command such as:GRANT ALL TO database.* 'username'@'host' IDENTIFIED BY 'password';Where database is the name of a database that already exists or you will create, username is a username, host is optional but you can specify localhost or an IP address and password is a password. You need to quit and restart mysql for the changes to take place. Then you can login with the command:mysql -u username -h host -pwith -h host optional if it's localhost. The -p parameter will force mysql to prompt you for the password. Quote Link to comment Share on other sites More sharing options...
nilson Posted November 29, 2003 Author Share Posted November 29, 2003 But I'm using winMySQLadmin, and the username is set in the config file... So do I still have to do this? Wait, I just got an idea.... sonce this is stored in a DB, maybe I should delete the old ones... let me try this first. Quote Link to comment Share on other sites More sharing options...
Peachy Posted November 29, 2003 Share Posted November 29, 2003 But I'm using winMySQLadmin, and the username is set in the config file... So do I still have to do this? Wait, I just got an idea.... sonce this is stored in a DB, maybe I should delete the old ones... let me try this first. Nilson,the username and password you used when you first ran winMySQLAdmin is NOT the same as the administrator name and password for the database 'mysql'. I ran into this when I was showing my class how to install MySQL. All the students seemed to have trouble logging in from the command line until I realised they weren't the same as the GUI admin program. Quote Link to comment Share on other sites More sharing options...
nilson Posted November 29, 2003 Author Share Posted November 29, 2003 Oh ok. I screwed it up again anyway... Once I download it and install again, I'll do what you said as you obviously know more than I do... I had no idea you had to do that. Quote Link to comment Share on other sites More sharing options...
teacher Posted November 29, 2003 Share Posted November 29, 2003 Nilson - that's the wonderful part about the forum. We get all that expert advice without any hassles! Quote Link to comment Share on other sites More sharing options...
nilson Posted November 30, 2003 Author Share Posted November 30, 2003 OK, so what do I do to get phpMyAdmin to work? How do I give root a password? Quote Link to comment Share on other sites More sharing options...
Peachy Posted November 30, 2003 Share Posted November 30, 2003 To set the root password or any password for a user, log into mysql as root. In this case on first start without the root password the command should be mysql -u root mysqlThis logs in as the root user using the mysql database. Then to set the password type the following command:UPDATE user SET Password = PASSWORD('password') WHERE User = 'root';Restart the mysql server and login with the command mysql -u root -p to test that it took the new password.To get phpMyAdmin up and running you need to edit the config.inc.php file. Find the * Server (s) configuration section. In the first server just add the values for host, user and password. If phpMyAdmin is running on the same host as the mysql database, host can be localhost. Quote Link to comment 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.