473,575 Members | 3,385 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why does Grant command fail?

I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?

I am guessing that "myid" and/or "mypw" might be wrong. If so, how do I find
out what the correct values should be?

Thanks....

Bruce A. Julseth
Jul 16 '05 #1
12 3911
A horsie named bruceaj demonstrated surprising intellligence and its
ability to use morse code on Sun, 07 Sep 2003 09:22:25 -0500 when it
tapped <3f********@new s1.prserv.net> with its hoof:
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?

I am guessing that "myid" and/or "mypw" might be wrong. If so, how do I
find out what the correct values should be?

Thanks....

Bruce A. Julseth


You can only grant privileges that you have, and since you
logged in anonymously, you are running as a user with almost
no privileges. Log-in as a more privileged user first. Only
grant priviledges that you want that user-name to have.

Do you really want this user-name to have DROP and SHUTDOWN
privileges?

Jul 16 '05 #2
I'm the only user of this machine. My user name, on my XP startup page, is
my name and I use NO password. This id has admin privileges.

Is this the user you are discussing in your reply? If so, would

Grant all on *.* to 'my name'@localhost identified as ???? What do I put
here since I don't use a password?

work. I tried it and, guess what? It didn't work. So I still don't know what
I'm doing!!

Since I have XP admin privileges, will I have to create a user id with a
password?

I'm going to try that approach but, on the assumption it won't work, I would
appreciate your comments.

Thanks....

Bruce

"Gary Petersen" <ga*******@remo ve.meearthlink. invalid> wrote in message
news:pa******** *************** *********@REMOV E.MEearthlink.I NVALID...
A horsie named bruceaj demonstrated surprising intellligence and its
ability to use morse code on Sun, 07 Sep 2003 09:22:25 -0500 when it
tapped <3f********@new s1.prserv.net> with its hoof:
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?

I am guessing that "myid" and/or "mypw" might be wrong. If so, how do I
find out what the correct values should be?

Thanks....

Bruce A. Julseth


You can only grant privileges that you have, and since you
logged in anonymously, you are running as a user with almost
no privileges. Log-in as a more privileged user first. Only
grant priviledges that you want that user-name to have.

Do you really want this user-name to have DROP and SHUTDOWN
privileges?

Jul 16 '05 #3
Okay. I created a new user with a password on my XP machine and issued the
following command under mysql,

Grant all on *.* to newuser@localho st identified as "newpw";

and got the same error, ERROR 1045: Access denied for user" '@localhost'
(Using password: NO)

<br*****@attglo bal.net> wrote in message news:3f******** @news1.prserv.n et...
I'm the only user of this machine. My user name, on my XP startup page, is
my name and I use NO password. This id has admin privileges.

Is this the user you are discussing in your reply? If so, would

Grant all on *.* to 'my name'@localhost identified as ???? What do I put here since I don't use a password?

work. I tried it and, guess what? It didn't work. So I still don't know what I'm doing!!

Since I have XP admin privileges, will I have to create a user id with a
password?

I'm going to try that approach but, on the assumption it won't work, I would appreciate your comments.

Thanks....

Bruce

"Gary Petersen" <ga*******@remo ve.meearthlink. invalid> wrote in message
news:pa******** *************** *********@REMOV E.MEearthlink.I NVALID...
A horsie named bruceaj demonstrated surprising intellligence and its
ability to use morse code on Sun, 07 Sep 2003 09:22:25 -0500 when it
tapped <3f********@new s1.prserv.net> with its hoof:
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?

I am guessing that "myid" and/or "mypw" might be wrong. If so, how do I find out what the correct values should be?

Thanks....

Bruce A. Julseth


You can only grant privileges that you have, and since you
logged in anonymously, you are running as a user with almost
no privileges. Log-in as a more privileged user first. Only
grant priviledges that you want that user-name to have.

Do you really want this user-name to have DROP and SHUTDOWN
privileges?


Jul 16 '05 #4
A horsie named bruceaj demonstrated surprising intellligence and its
ability to use morse code on Sun, 07 Sep 2003 22:21:44 -0500 when it
tapped <3f********@new s1.prserv.net> with its hoof:
Okay. I created a new user with a password on my XP machine and issued
the following command under mysql,

Grant all on *.* to newuser@localho st identified as "newpw";

and got the same error, ERROR 1045: Access denied for user"
'@localhost' (Using password: NO)


I don't use WinXP, but I'm assuming that the situation
is similar to my Slackware Linux machine.

The operating system's list of users is completely
separate from mysql's list of users. The fact that
you logged in to XP as an administrator does not
carry over to mysql. You would have to log into
mysql's administrator account(s) to create new users.
On my Slackware system, the only such account is
called "root"; this root account is completely separate
from the OS root account.

Read up on the GRANT command in the mysql manual, and
also read the section on privileges.

You probably want to create a user for php. You probably
do *not* want that user to have all powers. You probably
do *not* want that user to have access to all databases.

The grant command you gave above would give "newuser" all
rights to all databases. And so if someone compromised
the "newuser" account, they could change the passwords
of all accounts and lock you out of your db server. They
could also SHUTDOWN the server.

Instead, create the database and its tables under the
root user; then create a "newuser" with limited rights
*only* to that database.

Jul 16 '05 #5
<br*****@attglo bal.net> wrote in message news:3f******** @news1.prserv.n et...
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?
Well, this is a concern:
" '@localhost' (Using password: NO)


Why no user name? Perhaps you logged in as the anonymous user? I'd pretty
sure this user
cannot grant privileges, (he does now have a "with grant option" on his
account).

Did you log in to your server as root?
If this is a brand new installation without any changes (i..e you have not
yet assigned a
to root), try:

c:\whatever> mysql -u root -p
[hit enter to bypass password entry[
mysql> <--- should get a mysql prompt

Now try your grant:
mysql > Grant all on *.* to 'myid'@'localho st' identified by 'mypw';

That should work, I think??!!

HTH,
Mark
---------------------------------------------------------------------------
Windows, Linux and Internet Development Consultant
Email: co*******@scrip tsmiths.com
Web: http://www.scriptsmiths.com
---------------------------------------------------------------------------


I am guessing that "myid" and/or "mypw" might be wrong. If so, how do I find out what the correct values should be?

Thanks....

Bruce A. Julseth

Jul 16 '05 #6
A horsie named Mark Hewitt demonstrated surprising intellligence and its
ability to use morse code on Mon, 08 Sep 2003 08:59:02 -0500 when it
tapped <3f************ **@hades.is.co. za> with its hoof:
<br*****@attglo bal.net> wrote in message
news:3f******** @news1.prserv.n et...
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?


Well, this is a concern:
" '@localhost' (Using password: NO)


Why no user name? Perhaps you logged in as the anonymous user? I'd
pretty sure this user
cannot grant privileges, (he does now have a "with grant option" on his
account).

Did you log in to your server as root? If this is a brand new
installation without any changes (i..e you have not yet assigned a
to root), try:

[ creating a new mysql user with rights equal to root
(UNSAFE) snipped ]


bruceaj, don't do it. If you don't have time to read up
on the mysql priviledge system, just continue to log-in
anonymously and use the "test" database.

Using the test database allows you to play around with
creating and deleting tables and making queries without
all of fuss of creating a new user.

Jul 16 '05 #7
Mark:

Your suggestion worked.

Bruce
"Mark Hewitt" <co*******@scri ptsmiths.com> wrote in message
news:3f******** ******@hades.is .co.za...
<br*****@attglo bal.net> wrote in message news:3f******** @news1.prserv.n et...
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?


Well, this is a concern:
" '@localhost' (Using password: NO)


Why no user name? Perhaps you logged in as the anonymous user? I'd pretty
sure this user
cannot grant privileges, (he does now have a "with grant option" on his
account).

Did you log in to your server as root?
If this is a brand new installation without any changes (i..e you have not
yet assigned a
to root), try:

c:\whatever> mysql -u root -p
[hit enter to bypass password entry[
mysql> <--- should get a mysql prompt

Now try your grant:
mysql > Grant all on *.* to 'myid'@'localho st' identified by 'mypw';

That should work, I think??!!

HTH,
Mark
--------------------------------------------------------------------------

- Windows, Linux and Internet Development Consultant
Email: co*******@scrip tsmiths.com
Web: http://www.scriptsmiths.com
-------------------------------------------------------------------------- -

I am guessing that "myid" and/or "mypw" might be wrong. If so, how do I

find
out what the correct values should be?

Thanks....

Bruce A. Julseth


Jul 16 '05 #8
Gary:

I already have implemented Mark's suggestion.

As for sucurity, I wouldn't think this would be problem, in this case,
becasue I'm on a stand along machine that ONLY I use. Your idea of using the
test database should have worked,

As for "learning" mysql priviledge system, where can I get documentation?
Can you recommend a good book on the subject?

Thanks....

Bruce

"Gary Petersen" <ga*******@remo ve.meearthlink. invalid> wrote in message
news:pa******** *************** *********@REMOV E.MEearthlink.I NVALID...
A horsie named Mark Hewitt demonstrated surprising intellligence and its
ability to use morse code on Mon, 08 Sep 2003 08:59:02 -0500 when it
tapped <3f************ **@hades.is.co. za> with its hoof:
<br*****@attglo bal.net> wrote in message
news:3f******** @news1.prserv.n et...
I issued the mysql command

Grant all on *.* to myid@localhost identified as "mypw";

and recieved the error message

ERROR 1045: Access denied for user" '@localhost' (Using password: NO)

I am running mysql on my own machine which is not networked.

What am I doing wrong and how do I fix it?


Well, this is a concern:
" '@localhost' (Using password: NO)


Why no user name? Perhaps you logged in as the anonymous user? I'd
pretty sure this user
cannot grant privileges, (he does now have a "with grant option" on his
account).

Did you log in to your server as root? If this is a brand new
installation without any changes (i..e you have not yet assigned a
to root), try:

[ creating a new mysql user with rights equal to root
(UNSAFE) snipped ]


bruceaj, don't do it. If you don't have time to read up
on the mysql priviledge system, just continue to log-in
anonymously and use the "test" database.

Using the test database allows you to play around with
creating and deleting tables and making queries without
all of fuss of creating a new user.

Jul 16 '05 #9
A horsie named Bruce A. Julseth demonstrated surprising intelligence and
its ability to use morse code on Tue, 09 Sep 2003 04:22:35 -0500 when it
tapped <3f********@new s1.prserv.net> with its hoof:
[...]
As for "learning" mysql priviledge system, where can I get
documentation? Can you recommend a good book on the subject?


An electronic copy of the mysql manual was included on
my Slackware Linux CDs. Even though you are still using
Windows, you could get a CD and copy the manual (which
is in HTML format) from it.

In addition to using the installed mysql manual on my
system, I also used google to find some mysql tutorials
on the 'Net which proved to be very educational.

I didn't use any books, but I would advice you to get
one because learning from various documents strewn
all over the place is difficult compared to having
a consolidated, printed resource. Check Amazon.

Jul 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3834
by: Bruce A. Julseth | last post by:
I am doing something wrong or have something set up wrong. When I issue mysql> grant all on * to mike identified by 'joented' with grant option; Query OK, 0 rows affected (0.69 sec) It looks like the grant worked. Here is what the mysql.user table looks like.
14
1987
by: Martin v. Löwis | last post by:
The Python Software Foundation is seeking grant proposals for projects related to the further development of Python, Python-related technology, and educational resources. The PSF plans to issue calls for proposals regularly. Proposals should be for specific projects with a clear objective, rather than support for ongoing activities....
0
2016
by: Charles Cantrell | last post by:
I have recently set up mySQL on a Mandrake release of Linux (Version 7 of Mandrake, I believe), using the binary 4.0.13 standard release. The set up and start up all were normal, as far as I could tell, with no warnings or error messages. In nearly all respects, the database appears to be running as expected. I have the book "PHP and...
1
3494
by: Gregory Stone | last post by:
I've got a problem where any group or user permissions to the pg_class table aren't being registered by either psql or the JDBC driver. I issue the following command: GRANT ALL ON TABLE pg_class TO GROUP apps; -OR- GRANT ALL ON TABLE pg_class TO sculptor; Both apps and sculptor are valid user and group names respectively. The command...
1
4350
by: richard | last post by:
DB2 UDB v8.1.5 on Windows I want to grant some system function to user DB2 GRANT EXECUTE ON FUNCTION "SYSPROC".SNAPSHOT_DATABASE(INTEGER,VARCHAR()) TO USER This is the error message I got. DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:...
5
4966
by: Michael Fuhr | last post by:
I'd like to propose that certain GRANTs on a table cascade to the table's implicit sequences. In the current implementation (as of 7.4.5 and 8.0.0beta3), a table owner must typically issue GRANT statements on both the table and its sequences to allow other users to insert records into the table. The GRANT on the sequences seems superfluous....
11
2717
by: jobs239 | last post by:
Can I use this line inside C program "system(java -jar <jarfilename>)" to run a java program from C? Or do I have to use some JNI interface.?
4
5553
by: Jatinder | last post by:
Hi, I am trying to grant connect privilege to a user present on my O.S. (Windows) using following statement. GRANT CONNECT ON DATABASE TO user "user1" now when I execute this statemnt from db2 clp(ofcourse prefixing db2) it works fine, but when I put it inside an sql file and then when I try to run the file using db2 -tvf, it gives me...
0
1375
by: Serman D. | last post by:
Hi, I can't understand why mysql allows me to grant lock tables to all tables in a particular database, while it fails to accept the same command applied to a single table only. I've tested on MySQL versions 4.1.20 and 5.0.33 (both running CentOS 4.4 linux on Intel-32) with exact same results. Whats wrong with grant lock tables on a...
0
7845
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8120
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8281
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7868
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8143
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5664
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5338
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3797
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1382
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.