Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Newbie problem with GRANT statement
March 14, 2005, 5:58 pm
rate this thread
I'm sure there's some obvious answer, but why doesn't this work:
mysql> grant all on *.* to mailman@localhost identified by 'bar';
Query OK, 0 rows affected (0.04 sec)
Query OK, 0 rows affected (0.00 sec)
[xxx@localhost cgi-bin]$ mysql -u mailman/bar
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19 to server version: 4.1.8-standard
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use genes;
ERROR 1044 (42000): Access denied for user ''@'localhost' to database
If I granted ALL on everything, how can I not be able to use a database???
same result if I 'grant all on genes.*'
same result if I create a user 'foo' who is not in /etc/passwd
Re: Newbie problem with GRANT statement
no spam wrote:
You specified a password. That means that you must give that password
when you log in as that user name. MySQL will not prompt you for a
password unless you use the -p option, because creating a user name
_without_ a password is also supported in MySQL.
To use the -p option:
mysql -u mailman -pbar
(note the lack of a space between -p and bar -- it's important)
You can also omit the password string, and mysql will prompt you for it.
This is recommended in a multi-user environment, because people could
use `ps' to see your command-line arguments.
mysql -u mailman -p
For what it's worth, the MySQL user names have nothing to do with
/etc/passwd. You can make MySQL user names that are the same as those
in /etc/passwd, and they can even have different passwords than their
counterparts in /etc/passwd. Also note that if your MySQL user name is
the same as one in /etc/passwd, and you change the password for one or
the other, that password change doesn't apply to the other.
- » Application confirmation #1004685K Mon, 14 Mar 2005 18:32:15 -0800
- — Next thread in » MySQL Database Forum
- » Get previous and next records relative to an index record
- — Previous thread in » MySQL Database Forum
- » Americanas.com SALDO de TVs Com at 80% de Desconto (29798)
- — Newest thread in » MySQL Database Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — The site's Newest Thread. Posted in » Secure Shell Forum