473,750 Members | 2,527 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 3923
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
3855
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
1999
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. Proposals should be brief (a few pages of text), and they should explain: a. what the objective of the...
0
2024
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 mySQL Web Development" by Luke Welling and Laura Thomson, and have been working through the examples...
1
3511
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 executes fine and the following query produces:
1
4373
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: SQL0607N "GRANT OR REVOKE" is not defined for system objects.
5
4993
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. Consider, for example, what's probably the most common use of sequences: a SERIAL type...
11
2731
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
5565
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 following error msg
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 single table?
0
8839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9584
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9398
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9345
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8265
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4894
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3327
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2809
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.