472,146 Members | 1,370 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,146 software developers and data experts.

Problem with MySQL's GRANT

When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'

it came back with an error message:

SQL-query :

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@localhostIDENTIFIEDBY 'dodge3'

MySQL said:

You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'BY 'dodge3'' at line 1

For some reason, the words "localhost", "identified" and "by" were
stuck to each other.
I removed the "identified by 'dodge3'" and it worked fine.

Does anyone know why this is the case? Is it OK to grant these
privileges without a password required?
I was told that the problem is with "localhost". I checked the MySQL
documentation on their site and can't see what I am doing wrong.

Frpm documentation:

mysql> GRANT ALL PRIVILEGES ON *.* TO monty@localhost
-> IDENTIFIED BY 'some_pass'

I have:
GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'

Please HELP!
Jul 19 '05 #1
6 6769
Xerxes wrote:
When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'


mysql> create database sassisc;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
-> sassisc@localhost IDENTIFIED BY 'dodge3';
Query OK, 0 rows affected (0.12 sec)

So the query is okay AFAIK. What version of MySQL are you using and how
did you provide this query to MySQL? Have you tried using mysql console
program?

Jul 19 '05 #2
Xerxes wrote:
When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'


mysql> create database sassisc;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
-> sassisc@localhost IDENTIFIED BY 'dodge3';
Query OK, 0 rows affected (0.12 sec)

So the query is okay AFAIK. What version of MySQL are you using and how
did you provide this query to MySQL? Have you tried using mysql console
program?

Jul 19 '05 #3
Xerxes wrote:
When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'

it came back with an error message:

SQL-query :

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@localhostIDENTIFIEDBY 'dodge3'

MySQL said:

You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'BY 'dodge3'' at line 1

For some reason, the words "localhost", "identified" and "by" were
stuck to each other.
I removed the "identified by 'dodge3'" and it worked fine.

Does anyone know why this is the case? Is it OK to grant these
privileges without a password required?
I was told that the problem is with "localhost". I checked the MySQL
documentation on their site and can't see what I am doing wrong.


I'm not speaking from experience, just other messages I've read here, so
take this for what it's worth (a try, perhaps?)...

I'm guessing your doing this through a PHP admin interface.

The problem is that your space between the host name and the "IDENTIFIED
BY" is going away.

The "solution" that I've seen used here, although never explictly stated is:

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@'localhost' IDENTIFIED BY 'dodge3'

Note the additional apostrophes around the host name.

Good luck.
- Mark

Jul 19 '05 #4
Xerxes wrote:
When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'

it came back with an error message:

SQL-query :

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@localhostIDENTIFIEDBY 'dodge3'

MySQL said:

You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'BY 'dodge3'' at line 1

For some reason, the words "localhost", "identified" and "by" were
stuck to each other.
I removed the "identified by 'dodge3'" and it worked fine.

Does anyone know why this is the case? Is it OK to grant these
privileges without a password required?
I was told that the problem is with "localhost". I checked the MySQL
documentation on their site and can't see what I am doing wrong.


I'm not speaking from experience, just other messages I've read here, so
take this for what it's worth (a try, perhaps?)...

I'm guessing your doing this through a PHP admin interface.

The problem is that your space between the host name and the "IDENTIFIED
BY" is going away.

The "solution" that I've seen used here, although never explictly stated is:

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@'localhost' IDENTIFIED BY 'dodge3'

Note the additional apostrophes around the host name.

Good luck.
- Mark

Jul 19 '05 #5
Mark Sizer <gc*@15grant.com> wrote in message news:<3F**************@15grant.com>...
Xerxes wrote:
When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'

it came back with an error message:

SQL-query :

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@localhostIDENTIFIEDBY 'dodge3'

MySQL said:

You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'BY 'dodge3'' at line 1

For some reason, the words "localhost", "identified" and "by" were
stuck to each other.
I removed the "identified by 'dodge3'" and it worked fine.

Does anyone know why this is the case? Is it OK to grant these
privileges without a password required?
I was told that the problem is with "localhost". I checked the MySQL
documentation on their site and can't see what I am doing wrong.


I'm not speaking from experience, just other messages I've read here, so
take this for what it's worth (a try, perhaps?)...

I'm guessing your doing this through a PHP admin interface.

The problem is that your space between the host name and the "IDENTIFIED
BY" is going away.

The "solution" that I've seen used here, although never explictly stated is:

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@'localhost' IDENTIFIED BY 'dodge3'

Note the additional apostrophes around the host name.

Good luck.
- Mark

Hi Mark,
thanks a lot for the info.
I tried that but still had the same problem. And you are right, I
tried it using pma (phpMyAdmin). However, the first time I noticed it
was through my php program (part of a shopping cart application.) I
then tried to test it on pma and found that it, for some reason, gets
rid of the space between 'localhost' and 'IDENTIFIED'. I noticed that
it also adds an extra space between 'sassisc' and '*'. It works fine
with 'sassisc@localhost' if I remove the 'IDENTIFIED BY ...'

Regards.
Jul 19 '05 #6
Mark Sizer <gc*@15grant.com> wrote in message news:<3F**************@15grant.com>...
Xerxes wrote:
When I use the following GRANT statement

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc.* TO
sassisc@localhost IDENTIFIED BY 'dodge3'

it came back with an error message:

SQL-query :

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@localhostIDENTIFIEDBY 'dodge3'

MySQL said:

You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'BY 'dodge3'' at line 1

For some reason, the words "localhost", "identified" and "by" were
stuck to each other.
I removed the "identified by 'dodge3'" and it worked fine.

Does anyone know why this is the case? Is it OK to grant these
privileges without a password required?
I was told that the problem is with "localhost". I checked the MySQL
documentation on their site and can't see what I am doing wrong.


I'm not speaking from experience, just other messages I've read here, so
take this for what it's worth (a try, perhaps?)...

I'm guessing your doing this through a PHP admin interface.

The problem is that your space between the host name and the "IDENTIFIED
BY" is going away.

The "solution" that I've seen used here, although never explictly stated is:

GRANT SELECT , INSERT , UPDATE , DELETE ON sassisc. * TO
sassisc@'localhost' IDENTIFIED BY 'dodge3'

Note the additional apostrophes around the host name.

Good luck.
- Mark

Hi Mark,
thanks a lot for the info.
I tried that but still had the same problem. And you are right, I
tried it using pma (phpMyAdmin). However, the first time I noticed it
was through my php program (part of a shopping cart application.) I
then tried to test it on pma and found that it, for some reason, gets
rid of the space between 'localhost' and 'IDENTIFIED'. I noticed that
it also adds an extra space between 'sassisc' and '*'. It works fine
with 'sassisc@localhost' if I remove the 'IDENTIFIED BY ...'

Regards.
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Didier ROS | last post: by
reply views Thread by Tiffany Wilkes | last post: by
reply views Thread by Anil Garg | last post: by
reply views Thread by Gary Cote | last post: by
reply views Thread by Mark Adams | last post: by
3 posts views Thread by Mark Adams | last post: by
reply views Thread by Mark Adams | last post: by
Atli
6 posts views Thread by Atli | last post: by
reply views Thread by Saiars | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.