Jump to content

MySQL just won't work


nilson
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. :D

Link to comment
Share on other sites

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.  :D
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.
Link to comment
Share on other sites

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. :w00t:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...