Commit e88bce15 authored by Romain Courteaud's avatar Romain Courteaud

Allow mysql connection from localhost

As described in: http://dev.mysql.com/doc/refman/5.1/en/access-denied.html
"""
If you cannot figure out why you get Access denied, remove from the user  table
all entries that have Host values containing wildcards (entries that contain
'%' or '_'  characters). A very common error is to insert a new entry with
Host='%'  and User='some_user', thinking that this enables you to specify
localhost to connect from the same machine. The reason that this does not work
is that the default privileges include an entry with Host='localhost'  and
User=''. Because that entry has a Host value 'localhost' that is more specific
than '%', it is used in preference to the new entry when connecting from
localhost! The correct procedure is to insert a second entry with
Host='localhost'  and User='some_user', or to delete the entry with
Host='localhost'  and User=''. After deleting the entry, remember to issue a
FLUSH PRIVILEGES statement to reload the grant tables.
"""
parent 2d8c0f42
CREATE DATABASE IF NOT EXISTS %(mysql_database)s;
GRANT ALL PRIVILEGES ON %(mysql_database)s.* TO %(mysql_user)s@'%%' IDENTIFIED BY '%(mysql_password)s';
GRANT ALL PRIVILEGES ON %(mysql_database)s.* TO %(mysql_user)s@'localhost' IDENTIFIED BY '%(mysql_password)s';
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment