Professional Web Applications Themes

Access Denied after upgrade to 5.0.15 - MySQL

Hello group, I recently upgraded to mysql 5.0.15 and I now I cannot connect to the database server. Not that I think this is an OS issue, but I am running FreeBSD 6.0 RELEASE. Here is my output from the console: (poseidon:root) / # mysql --user=root -p Enter password: ERROR 1045 (28000): Access denied for user 'root''localhost' (using password: YES) (poseidon:root) / # So, then I followed the procedures for Unix on this page: [url]http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html[/url] and I still get the above error! I am not a database admin by any stretch (this is my personal machine which I do some ...

  1. #1

    Default Access Denied after upgrade to 5.0.15

    Hello group,

    I recently upgraded to mysql 5.0.15 and I now I cannot connect to the
    database server. Not that I think this is an OS issue, but I am running
    FreeBSD 6.0 RELEASE.

    Here is my output from the console:

    (poseidon:root) / # mysql --user=root -p
    Enter password:
    ERROR 1045 (28000): Access denied for user 'root''localhost' (using
    password: YES)
    (poseidon:root) / #

    So, then I followed the procedures for Unix on this page:

    [url]http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html[/url]

    and I still get the above error!

    I am not a database admin by any stretch (this is my personal machine which
    I do some PHP coding on). Although I have set up PostgresSQL and I know that
    package does do host-based authentication, does mysql now do this? In other
    words, is there some sort of host file that I need to set up for local and
    remote access to the database server?

    Any help is appreciated,

    AJ Schroeder


    Schroeder, AJ Guest

  2. #2

    Default Re: Access Denied after upgrade to 5.0.15

    Hi,

    MySQL's permissions are set according to the entries in the tables user, db,
    tables_priv and columns_priv in the database 'mysql'. There is no relation
    to the operating system's users at all, although it could be possible that
    some installation routines create a MySQL user that's identical to your OS
    user (I'm not sure about that). But it's best to take a look into the
    mentioned tables or use the SHOW GRANTS command.

    If you can't login anymore at all, add the following line to the [mysqld]
    section of your my.cnf file (on Linux it's usually in the /etc directory):

    [mysql]
    skip-grant-tables

    Then you can log in without any user authentification at all. Check the
    tables mysql.user (and maybe mysql.db, mysql.tables_priv and
    mysql.columns_priv) to see how the user's permissions are set. You can also
    modify the tables directly to set them according to your needs (however, if
    you NEED to change the tables, you HAVE to update them directly as you
    cannot use GRANT and REVOKE commands while you run the server with the
    skip-grant-tables modifier).

    When you're done, remove the skip-grant-tables entry and restart the server.

    If you run a security critical system, make sure that network access is
    disabled while you run the server with the skip-grant-tables entry, because
    EVERYBODY can log in and get administration permissions during that time!

    Markus


    Markus Popp Guest

  3. #3

    Default Re: Access Denied after upgrade to 5.0.15

    Markus Popp wrote:
    > Hi,
    >
    > MySQL's permissions are set according to the entries in the tables
    > user, db, tables_priv and columns_priv in the database 'mysql'. There
    > is no relation to the operating system's users at all, although it
    > could be possible that some installation routines create a MySQL user
    > that's identical to your OS user (I'm not sure about that). But it's
    > best to take a look into the mentioned tables or use the SHOW GRANTS
    > command.
    >
    > If you can't login anymore at all, add the following line to the
    > [mysqld] section of your my.cnf file (on Linux it's usually in the
    > /etc directory):
    >
    > [mysql]
    > skip-grant-tables
    >
    > Then you can log in without any user authentification at all. Check
    > the tables mysql.user (and maybe mysql.db, mysql.tables_priv and
    > mysql.columns_priv) to see how the user's permissions are set. You
    > can also modify the tables directly to set them according to your
    > needs (however, if you NEED to change the tables, you HAVE to update
    > them directly as you cannot use GRANT and REVOKE commands while you
    > run the server with the skip-grant-tables modifier).
    >
    > When you're done, remove the skip-grant-tables entry and restart the
    > server.
    >
    > If you run a security critical system, make sure that network access
    > is disabled while you run the server with the skip-grant-tables
    > entry, because EVERYBODY can log in and get administration
    > permissions during that time!
    >
    > Markus
    Markus,

    I did what you said, which was consistent with the MySQL doentation (and
    the steps I had done previously) but instead of re-trying to fix permissions
    that I tried before, I decided to do a mysqldump and get a backup copy of
    the database and then re-install MySQL.

    After a re-install, I restored the backup and everything (sans a few
    permissions) came back without any problems.

    I wonder what the upgrade could have done? Would some corruption be caused
    if mysql was "replaced" while mysql was running?

    AJ Schroeder


    Schroeder, AJ Guest

  4. #4

    Default Re: Access Denied after upgrade to 5.0.15

    Hi,

    the grant tables (the tables in the mysql database) are read in the
    following cases:

    * when you start the server
    * when you run a CREATE USER, DROP USER, GRANT or REVOKE command
    * when you run a FLUSH PRIVILEGES command

    If you replace the data files while the server is running (which is not
    recommanded, however, it shouldn't make problems if you are the only user
    and no one reads from the tables while you copy the data), the server
    doesn't re-read the grant tables, so the old privileges should still be in
    place, until one of the mentioned three actions happen.

    Markus


    Markus Popp Guest

Similar Threads

  1. Adobe Pro 7.0.9 Upgrade, Access is Denied to CLSID and ActiveX
    By Jeremy_R_Lindsey@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 2
    Last Post: January 18th, 10:15 PM
  2. One With Access Denied, Another With Access, But NotFull
    By checkersam in forum Macromedia Contribute Connection Administrtion
    Replies: 2
    Last Post: May 10th, 06:43 PM
  3. Web Service + Anon Access, but getting 401 Access Denied Error
    By Alex Washtell via .NET 247 in forum ASP.NET Web Services
    Replies: 1
    Last Post: April 5th, 04:57 PM
  4. Access denied when creating Access application object
    By Bill Murphy in forum ASP Database
    Replies: 7
    Last Post: July 31st, 05:37 PM
  5. access denied on data access pages
    By Bonnie in forum Microsoft Access
    Replies: 0
    Last Post: July 15th, 06:03 PM

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