Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

Problem:

I just set up a Debian Wheezy installation for testing, and installed the LAMP packages and PMA.

I can log in as root with my pre-defined password, create/edit/delete both databases and users. The problem comes when I create a new user 'something', set a password for it, and grant it all privileges on a table 'something' (same as the username). Upon connecting, it denies access to the user.

Details:

  • Host: localhost using MySQL 5.5.24-8

  • Creating user: CREATE USER 'something'@'%' IDENTIFIED BY '***';GRANT USAGE ON *.* TO 'something'@'%' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;CREATE DATABASE IF NOT EXISTSsomething;GRANT ALL PRIVILEGES ONsomething.* TO 'something'@'%';

  • Checking privileges: GRANT USAGE ON *.* TO 'something'@'%' IDENTIFIED BY PASSWORD '*92F9DAF5F5129554509489FDB6A433510223C799';

  • Result: Access denied for user 'something'@'localhost' (using password: YES)

More Info:

I use this same exact procedure for the Squeeze distribution, and it works perfectly. Is there a chance it's because of Wheezy, or something else? I need to continue using Wheezy because of the updated packages (for this test server -- the others work fine), so 'just use Squeeze' is not an option. Note: I HAVE tried flush privileges; to no avail.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Think I have found the problem:

You created the access for something@'%' but not for something@'localhost'

% is not localhost for MySQL, you have to make another addition. This is why the error message is complaining about something@'localhost'

http://dev.mysql.com/doc/refman/5.5/en//adding-users.html

share|improve this answer
    
Thanks, worked. But I'd still like to know why it works in Squeeze and not Wheezy with the wildcard % host. –  ionFish Sep 16 '12 at 16:58
    
Yes and No, you have to add localhost prior % (yes two additions for the same user) it is mentioned and the link I have provided. –  jflaflamme Sep 16 '12 at 17:04
    
Look in the link provided with the line starting by "It is necessary to have both accounts" it may answer all your questions –  jflaflamme Sep 16 '12 at 17:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.