Bug #27505 piping a script with a created user gets 'access denied' error
Submitted: 28 Mar 2007 19:45 Modified: 28 Mar 2007 20:10
Reporter: marc castrovinci (Basic Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.16 beta OS:Linux (Ubuntu Linux)
Assigned to: CPU Architecture:Any
Tags: access denied, error, pipe, piping, qc, script, user

[28 Mar 2007 19:45] marc castrovinci
Description:
After creating a user I try to pipe sql script into the database I get the error --- ERROR 1044 (42000) at line 1: Access denied for user ''@'localhost' to database 

However I can sign in fine when I do not have the script pipeing.

How to repeat:
create user testuser;
grant all on bugtest.* to testuser;
create database bugtest;

create a file named test.sql and enter:
-----------------------------------------
use bugtest;

create table testtable (aaa integer) engine=NDBCLUSTER;
insert into aaa values (1),(2);
-----------------------------------------

mysql -u testuser -p < test.sql 
Enter password: 
ERROR 1044 (42000) at line 1: Access denied for user ''@'localhost' to database 'bugtest'
[28 Mar 2007 19:46] marc castrovinci
I forgot to mention. After then do a normal login.

mysql -u testuser -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.1.16-beta MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>
[28 Mar 2007 20:10] Giuseppe Maxia
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php