root pass wont change

Ask a Question related to MySQL, Design and Development.

  1. #1

    Default root pass wont change

    I have installed 5.0.18 on FreeBSD 5.3. from ports.
    No root passord set for mysql on any host.
    Please help. I have no idea. Can I just >make deinstall reinstall; or would
    I need to delete some database files first?


    shell>/usr/local/bin/mysqld_safe --skip-grant-tables &
    shell>mysqladmin -u root password 'mypassword'
    mysqladmin:
    You cannot use 'password' command as mysqld runs
    with grant tables disabled (was started with --skip-grant-tables).
    Use: "mysqladmin flush-privileges password '*'" instead
    shell> mysqladmin flush-privileges password 'mypassword'
    mysqladmin: unable to change password; error: 'Can't find any matching row
    in the user table'

    I also try (with --skip-grant-tables)

    mysql> UPDATE user SET Password=PASSWORD('mypassword') WHERE
    Host='localhost' AND User='root';
    Query OK, 0 rows affected (0.00 sec)
    Rows matched: 0 Changed: 0 Warnings: 0

    mysql> SELECT * from user WHERE User='root';
    Empty set (0.00 sec)

    mysql> select * from user;
    +--------------------------------------------------------------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
    | Host | User
    | Password | Select_priv | Insert_priv |
    Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv |
    Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv |
    Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv
    | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv |
    ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions |
    max_updates | max_connections |
    +--------------------------------------------------------------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
    | localhost | root
    | | Y | Y | Y
    | Y | Y | Y | Y | Y | Y
    | Y | Y | Y | Y | Y



    7B4 Guest

  2. Similar Questions and Discussions

    1. Change root folder ?
      I've been using ColdFusion for a while, but this is my first time configuring a server. I know it's possible, but I've been up and down the...
    2. Line thickness wont change:(
      Someone please help. I can't seem to get the stroke thickness of a line I have drawn to change from .025 to 8pts. Can anyone help? Michelle
    3. how to pass varaible from root to external swf
      Hello I have a swf with use: Host.loadMovie("X.swf") to load inside it another swf file. how can i pass variables form the host to X?? Thanks, Ido
    4. Can I Change root directory???
      I created a root directory a couple days ago that I have been saving all my files in...... I now actually want to place all my files in a new...
    5. XP Field Text Colour wont change
      I have a solution developed on a Mac 10.2.6 FM Dev 6.0v4 when I run it on windows xp an address(text) field with the text colour selected as black...
  3. #2

    Default Re: root pass wont change

    "7B4" <a@a.com> wrote in message news:43f40e94@dnews.tpgi.com.au...
    >I have installed 5.0.18 on FreeBSD 5.3. from ports.
    > No root passord set for mysql on any host.
    > Please help. I have no idea.
    There are examples of several methods to reset the MySQL root password on
    this page:
    [url]http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html[/url]

    I think the third method may be the best for your situation. Remember to
    FLUSH PRIVILEGES after every time you update the mysql.user table.

    Also read the user comments, they're useful and informative.

    Regards,
    Bill K.


    Bill Karwin Guest

  4. #3

    Default Re: root pass wont change

    First off, it seems odd that if this were a default installation there
    would be only 1 user.

    Secondly, your query should work - unless you've got something odd
    going on (for example, there are some "extra" characters in the user or
    host fields).

    Why don't you start the server with the --skip-grant-tables option.
    Then add a user (using an insert statement). Give the user all
    privileges and a password - see if that works. You'll essentially
    creating a new "root" user.

    If that works, delete your current root user and start over.

    Another possibility is that the user that the server runs as doesn't
    have write access (for some reason..) to the user table (permissions
    problem, perhaps?) Though when this sort of thing occurs you should
    see some output in your error logs...and the server typically won't
    start.

    You can also just re-initialize the database (mysql_install_db) - once
    again, make sure the permissions are set correctly for the user that
    the server runs as before starting it.

    --
    Chander Ganesan
    Open Technology Group, Inc.
    Expert MySQL Training - at your site or ours
    [url]http://www.otg-nc.com/training-courses/category.php?cat_id=1[/url]

    Chander Ganesan Guest

  5. #4

    Default Re: root pass wont change

    Thanks for your direction.

    As usual it was stupid user error. I was starting the server without the
    user option. When I started with user mysql everything was good to go.

    Again, thanks your input certainly sorted me out.

    "7B4" <a@a.com> wrote in message news:43f40e94@dnews.tpgi.com.au...
    >I have installed 5.0.18 on FreeBSD 5.3. from ports.
    > No root passord set for mysql on any host.
    > Please help. I have no idea. Can I just >make deinstall reinstall; or
    > would I need to delete some database files first?
    >
    >
    > shell>/usr/local/bin/mysqld_safe --skip-grant-tables &
    > shell>mysqladmin -u root password 'mypassword'
    > mysqladmin:
    > You cannot use 'password' command as mysqld runs
    > with grant tables disabled (was started with --skip-grant-tables).
    > Use: "mysqladmin flush-privileges password '*'" instead
    > shell> mysqladmin flush-privileges password 'mypassword'
    > mysqladmin: unable to change password; error: 'Can't find any matching row
    > in the user table'
    >
    > I also try (with --skip-grant-tables)
    >
    > mysql> UPDATE user SET Password=PASSWORD('mypassword') WHERE
    > Host='localhost' AND User='root';
    > Query OK, 0 rows affected (0.00 sec)
    > Rows matched: 0 Changed: 0 Warnings: 0
    >
    > mysql> SELECT * from user WHERE User='root';
    > Empty set (0.00 sec)
    >
    > mysql> select * from user;
    > +--------------------------------------------------------------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
    > | Host | User |
    > Password | Select_priv | Insert_priv |
    > Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv |
    > Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv |
    > Index_priv | Alter_priv | Show_db_priv | Super_priv |
    > Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv
    > | Repl_client_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject |
    > max_questions | max_updates | max_connections |
    > +--------------------------------------------------------------+------------------+-------------------------------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+
    > | localhost | root |
    > | Y | Y | Y | Y | Y | Y |
    > Y | Y | Y | Y | Y | Y
    > | Y | Y
    >
    >
    >

    7B4 Guest

Posting Permissions

  • You may not post new threads
  • You may 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