By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,433 Members | 776 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,433 IT Pros & Developers. It's quick & easy.

Problem with MySQL's GRANT

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.