Professional Web Applications Themes

Why does Grant command fail? - PHP Development

I issued the mysql command Grant all on *.* to myidlocalhost 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...

  1. #1

    Default Why does Grant command fail?

    I issued the mysql command

    Grant all on *.* to myidlocalhost 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


    Guest

  2. #2

    Default Re: Why does Grant command fail?

    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 <3f5b3ff4_2news1.prserv.net> with its hoof:
    > I issued the mysql command
    >
    > Grant all on *.* to myidlocalhost 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?

    Gary Petersen Guest

  3. #3

    Default Re: Why does Grant command fail?

    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" <garyp1492remove.meearthlink.invalid> wrote in message
    news:pan.2003.09.07.20.51.33.847420.334REMOVE.MEe arthlink.INVALID...
    > 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 <3f5b3ff4_2news1.prserv.net> with its hoof:
    >
    > > I issued the mysql command
    > >
    > > Grant all on *.* to myidlocalhost 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?
    >

    Guest

  4. #4

    Default Re: Why does Grant command fail?

    Okay. I created a new user with a password on my XP machine and issued the
    following command under mysql,

    Grant all on *.* to newuserlocalhost identified as "newpw";

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

    <bruceajattglobal.net> wrote in message news:3f5befb6_3news1.prserv.net...
    > 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" <garyp1492remove.meearthlink.invalid> wrote in message
    > news:pan.2003.09.07.20.51.33.847420.334REMOVE.MEe arthlink.INVALID...
    > > 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 <3f5b3ff4_2news1.prserv.net> with its hoof:
    > >
    > > > I issued the mysql command
    > > >
    > > > Grant all on *.* to myidlocalhost 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?
    > >
    >
    >

    Guest

  5. #5

    Default Re: Why does Grant command fail?

    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 <3f5bf6a2_1news1.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 newuserlocalhost 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.

    Gary Petersen Guest

  6. #6

    Default Re: Why does Grant command fail?

    <bruceajattglobal.net> wrote in message news:3f5b3ff4_2news1.prserv.net...
    > I issued the mysql command
    >
    > Grant all on *.* to myidlocalhost 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''localhost' identified by 'mypw';

    That should work, I think??!!

    HTH,
    Mark
    ---------------------------------------------------------------------------
    Windows, Linux and Internet Development Consultant
    Email: [email]corporatescriptsmiths.com[/email]
    Web: [url]http://www.scriptsmiths.com[/url]
    ---------------------------------------------------------------------------

    >
    > 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
    >
    >

    Mark Hewitt Guest

  7. #7

    Default Re: Why does Grant command fail?

    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 <3f5c8a5c$0$64727hades.is.co.za> with its hoof:
    > <bruceajattglobal.net> wrote in message
    > news:3f5b3ff4_2news1.prserv.net...
    >> I issued the mysql command
    >>
    >> Grant all on *.* to myidlocalhost 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.

    Gary Petersen Guest

  8. #8

    Default Re: Why does Grant command fail?

    Mark:

    Your suggestion worked.

    Bruce
    "Mark Hewitt" <corporatescriptsmiths.com> wrote in message
    news:3f5c8a5c$0$64727hades.is.co.za...
    > <bruceajattglobal.net> wrote in message
    news:3f5b3ff4_2news1.prserv.net...
    > > I issued the mysql command
    > >
    > > Grant all on *.* to myidlocalhost 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''localhost' identified by 'mypw';
    >
    > That should work, I think??!!
    >
    > HTH,
    > Mark
    > --------------------------------------------------------------------------
    -
    > Windows, Linux and Internet Development Consultant
    > Email: [email]corporatescriptsmiths.com[/email]
    > Web: [url]http://www.scriptsmiths.com[/url]
    > --------------------------------------------------------------------------
    -
    >
    >
    > >
    > > 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
    > >
    > >
    >
    >

    Bruce A. Julseth Guest

  9. #9

    Default Re: Why does Grant command fail?

    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 doentation?
    Can you recommend a good book on the subject?

    Thanks....

    Bruce

    "Gary Petersen" <garyp1492remove.meearthlink.invalid> wrote in message
    news:pan.2003.09.09.02.20.23.559607.489REMOVE.MEe arthlink.INVALID...
    > 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 <3f5c8a5c$0$64727hades.is.co.za> with its hoof:
    >
    > > <bruceajattglobal.net> wrote in message
    > > news:3f5b3ff4_2news1.prserv.net...
    > >> I issued the mysql command
    > >>
    > >> Grant all on *.* to myidlocalhost 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.
    >

    Bruce A. Julseth Guest

  10. #10

    Default Re: Why does Grant command fail?

    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 <3f5d9caa_3news1.prserv.net> with its hoof:
    > [...]
    > As for "learning" mysql priviledge system, where can I get
    > doentation? 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 doents strewn
    all over the place is difficult compared to having
    a consolidated, printed resource. Check Amazon.

    Gary Petersen Guest

  11. #11

    Default Re: Why does Grant command fail?

    I can probably download a manual from the MySQL site. Thanks. As for a book,
    I was hoping someone could suggest a good learning book. From Amazon, I have
    to go by the "Sales Pitch" they put together. Our local Barnes and Noble is
    pretty light on computer books, but I will try them.

    Maybe some out there in PHP/MySQL can suggest a good book for learning
    MySQL.

    Thanks for the response.

    Bruce

    "Gary Petersen" <garyp1492remove.meearthlink.invalid> wrote in message
    news:pan.2003.09.09.15.23.10.677146.336REMOVE.MEe arthlink.INVALID...
    > 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 <3f5d9caa_3news1.prserv.net> with its hoof:
    >
    > > [...]
    > > As for "learning" mysql priviledge system, where can I get
    > > doentation? 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 doents strewn
    > all over the place is difficult compared to having
    > a consolidated, printed resource. Check Amazon.
    >

    Bruce A. Julseth Guest

  12. #12

    Default Re: Why does Grant command fail?

    "Bruce A. Julseth" <bruceajattglobal.net> wrote in message
    >Our local Barnes and Noble is pretty light on
    >computer books, but I will try them.
    What is the world coming to? A Barnes and Noble that's light on
    computer books? That's like a Starbucks without too much cream, or a
    webdesigner without a personal webpage.
    lawrence Guest

  13. #13

    Default Re: Why does Grant command fail?

    My sentiments exactly...

    I did find and bought
    PHP and MySQL Web Development, Second Edition [Paperback]
    By: Luke Welling (Author), Laura Thomson (Author)

    It looked good to me. Hope it is...

    Bruce

    "lawrence" <lkrubnergeocities.com> wrote in message
    news:da7e68e8.0309091406.2982c342posting.google.c om...
    > "Bruce A. Julseth" <bruceajattglobal.net> wrote in message
    > >Our local Barnes and Noble is pretty light on
    > >computer books, but I will try them.
    >
    > What is the world coming to? A Barnes and Noble that's light on
    > computer books? That's like a Starbucks without too much cream, or a
    > webdesigner without a personal webpage.

    Bruce A. Julseth Guest

Similar Threads

  1. The real Andrew Grant
    By Andley Jandley in forum Macromedia ColdFusion
    Replies: 0
    Last Post: June 30th, 06:33 AM
  2. GRANT EXECUTE not working
    By ben h in forum ASP Database
    Replies: 1
    Last Post: July 14th, 11:36 AM
  3. Grant Command Syntax
    By Kubaton Lover in forum PHP Development
    Replies: 0
    Last Post: November 4th, 07:58 PM
  4. Grant access
    By robo20 in forum Windows Setup, Administration & Security
    Replies: 0
    Last Post: July 10th, 05:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139