Add user to mysql database issues!!!

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Add user to mysql database issues!!!

Post by kingdbag »

Hey,

I'm trying to add a user to a mySQL database and this is what I have so far:

User Host Password Global privileges Grant
atlanta % Yes SELECT No

When I try to log onto it from the server its running on its saying:

~]# mysql -u atlanta -p
Enter password:
ERROR 1045: Access denied for user: 'atlanta@localhost' (Using password: YES)

I have no idea what i'm doing wrong... Can someone help me?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Are you setting up the user via the command line or with phpmyadmin?

If the command line, what happens when you run this query from the `mysql` database:

Code: Select all

SELECT
 *
FROM
 user
WHERE
 user = 'atlanta'
Your password should be encrypted using MySQL's password() command, so if the password is in plain text - there's your problem.

Also, if you use the

Code: Select all

[/code ] tags around command line stuff (such as database query results), it spaces things much nicer.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Post by kingdbag »

I used phpMyAdmin to create the user.

I have reloaded the privlieges with phpMyAdmin

Code: Select all

FLUSH PRIVILEGES;
Last edited by kingdbag on Wed May 23, 2007 6:16 pm, edited 3 times in total.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Don't forget to reload the privileges, in phpMyAdmin, I believe it would be Reload MySQL
kingdbag
Forum Newbie
Posts: 22
Joined: Wed Jul 12, 2006 6:22 pm

Post by kingdbag »

Its working now....I read someplace that you need to add the user to localhost and also % I did that and it works... I think thats what fixed it.
Post Reply