Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add user

Status
Not open for further replies.

csniffer

Programmer
Apr 30, 2003
161
GB
got this from a book to add a user with all pivi but didnt work, does anybody know why. thx

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, FILE ON students.* To sean@JSTTECH IDENTIFIED BY 'SSSS';

To err is human, to completely mess up takes a computer. [morning]
 
Sorry that does lack any descriptive qualities, the error was:
Code:
C:\mysql\bin>mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 172 to server version: 4.0.14-nt

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

mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, FILE ON
 students.* To sean@JSTTECH IDENTIFIED BY 'SSSS';
ERROR 1221: Wrong usage of DB GRANT and GLOBAL PRIVILEGES
mysql>
thx

To err is human, to completely mess up takes a computer. [morning]
 
If "doesn't work" means "MySQL reports and error I haven't posted", then there is one possibility.

The "FILE" privilege, I think, is a global privilege that can't be assigned to a single database.

If "doesn't work" means "I've verified the user was created, but can't login as that user", then it's probably your use of "@JSTTECH" in the username. Since that can't be resolved to an IP address, MySQL probably will never let that user in.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
JSTTECH is my apache server that is on the same machine as MySQL i can use myname & mypass and that works fine with this. what i am trying to do is add a user to the database "students" the syntax is from a book, is that any clearer? please let me know if it isn’t or if i am doing something wrong in the process of adding a user. thx T

To err is human, to completely mess up takes a computer. [morning]
 
On my server (4.0.14), the query runs fine after I remove the privilege "FILE" from the list.

Some MySQL privileges are considered global privileges and cannot be assigned when you use "on databasename.*" but only when you use "on *.*". It looks like FILE is one of these privileges -- on my machine I can only assign FILE privilege when I use "on *.*".

It could be that your book assumes a different version of MySQL than the one you have installed. It could be your book is in error.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
hmm i will give that a try. what does this mean *.* or *.*".
thx T

To err is human, to completely mess up takes a computer. [morning]
 
The "ON" clause of a GRANT query can take any of several values.

"ON tablename" means "apply the privilege to the table named 'tablename' in the current database".

"ON dbname.tablename" means "apply the privilege to the table 'tablename' in the database 'dbname'"

"ON dbname.*" means "apply the privilege to any table in the database 'dbname'".

"ON *.*" means "apply the privilege to any table in any database" or more simply "apply the privilege globally".

For more information:


Want the best answers? Ask the best questions: TANSTAAFL!!
 
still seem to be doing something wrong, although the error has changed now i have removed the FILE
Code:
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, ON students.* TO sean@JSTTECH IDENTIFIED BY 'SSSS';

ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresp
onds to your MySQL server version for the right syntax to use near 'ON students.* TO sean@JSTTECH IDENTIFIED BY 'SSSS'' at line 1

thx 4 the description

To err is human, to completely mess up takes a computer. [morning]
 
mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX ON stude
nts.studentdetails TO sean@JSTTECH IDENTIFIED BY 'SSSS';
Query OK, 0 rows affected (0.03 sec)

hmmm ok thx 4 not telling me


To err is human, to completely mess up takes a computer. [morning]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top