I just ran /usr/bin/mysql_install_db and it told me to set a password for the MySQL root USER. I cannot.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MLH

    I just ran /usr/bin/mysql_install_db and it told me to set a password for the MySQL root USER. I cannot.

    I'm supposed to set a password for the MySQL root user. The output of
    mysql_install_d b instructed me to run the following commands...
    /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd
    I did. It did not work. Here's the error:
    /usr/bin/mysqladmin: connect to server at 'appserver' failed
    error: 'Host 'appserver.crci .com' is not allowed to connect to this
    MySQL server'

    Another command I'm supposed to run also resulted in an error. Here
    is the command and the ensuing error...
    /usr/bin/mysqladmin -u root password mynewpassword
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost ' (Using password: NO)'

    Can anyone tell me why I am getting these error messages and how
    I can successfully set a password for the MySQL root user?

    xxxxxxxxxxxxxxx xx mysql_install_d b screen output xxxxxxxxxxxxxxx xxxx
    Here's text of /usr/bin/mysql_install_d b output to screen...

    Installing all prepared tables

    To start mysqld at boot time you have to copy
    support-files/mysql.server
    to the right place for your system

    PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
    To do so, start the server, then issue the following commands:
    /etc/init.d/mysql start (you have to start the server first!)
    /usr/bin/mysqladmin -u root -h appserver password 'new-password'
    /usr/bin/mysqladmin -u root password 'new-password'
    See the manual for more instructions.

    NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
    the /usr/bin/mysql_fix_privi lege_tables. Otherwise you will not be
    able to use the new GRANT command!

    You can start the MySQL daemon with:
    cd /usr ; /usr/bin/mysqld_safe &

    You can test the MySQL daemon with the benchmarks in the 'sql-bench'
    directory:
    cd sql-bench ; perl run-all-tests

    Please report any problems with the /usr/bin/mysqlbug script!

    The latest information about MySQL is available on the web at

    Support MySQL by buying support/licenses at https://order.mysql.com

  • Bill Karwin

    #2
    Re: I just ran /usr/bin/mysql_install_d b and it told me to set apassword for the MySQL root USER. I cannot.

    MLH wrote:[color=blue]
    > /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd
    > I did. It did not work. Here's the error:
    > /usr/bin/mysqladmin: connect to server at 'appserver' failed
    > error: 'Host 'appserver.crci .com' is not allowed to connect to this
    > MySQL server'[/color]

    This depends on the privileges set up for MySQL on that host. It's
    certainly possible that it's configured to deny _any_ account from
    connecting from another host. Or it could be that it's configured to
    deny root when you don't supply a password.

    The "-u root" without an accompanying "-p" means "I want to connect as
    root, without giving a password." It's not unusual for people to
    configure MySQL to disallow this.

    The requirement to specify the "-p" option is there because MySQL also
    allows you to configure accounts so that they _can_ connect without
    requiring the password. You could even configure one account such that
    if you don't specify a password, you get some limited privileges, but if
    you do specify a password for the same account, you get a different set
    of privileges! So there has to be a way to run the mysql commands both
    with and without specifying a password. IMHO, the syntax they've chosen
    to implement this feature isn't necessarily the most clear in
    retrospect, but there might have been some historical reason for them to
    do it the way they did.
    [color=blue]
    > /usr/bin/mysqladmin -u root password mynewpassword
    > /usr/bin/mysqladmin: connect to server at 'localhost' failed
    > error: 'Access denied for user: 'root@localhost ' (Using password: NO)'[/color]

    This means that you tried to connect as root to set root's password, but
    you specified no password. MySQL seems to want root's current
    password before it'll let you do that.

    Sounds like you should contact the person who sold you this server, and
    ask what is the current MySQL root password.

    Regards,
    Bill K.

    Comment

    • MLH

      #3
      Re: I just ran /usr/bin/mysql_install_d b and it told me to set a password for the MySQL root USER. I cannot.

      On Sun, 27 Mar 2005 20:06:13 -0800, Bill Karwin <bill@karwin.co m>
      wrote:
      [color=blue]
      >MLH wrote:[color=green]
      >> /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd
      >> I did. It did not work. Here's the error:
      >> /usr/bin/mysqladmin: connect to server at 'appserver' failed
      >> error: 'Host 'appserver.crci .com' is not allowed to connect to this
      >> MySQL server'[/color]
      >
      >This depends on the privileges set up for MySQL on that host. It's
      >certainly possible that it's configured to deny _any_ account from
      >connecting from another host. Or it could be that it's configured to
      >deny root when you don't supply a password.
      >
      >The "-u root" without an accompanying "-p" means "I want to connect as
      >root, without giving a password." It's not unusual for people to
      >configure MySQL to disallow this.
      >
      >The requirement to specify the "-p" option is there because MySQL also
      >allows you to configure accounts so that they _can_ connect without
      >requiring the password. You could even configure one account such that
      >if you don't specify a password, you get some limited privileges, but if
      >you do specify a password for the same account, you get a different set
      >of privileges! So there has to be a way to run the mysql commands both
      >with and without specifying a password. IMHO, the syntax they've chosen
      >to implement this feature isn't necessarily the most clear in
      >retrospect, but there might have been some historical reason for them to
      >do it the way they did.
      >[color=green]
      >> /usr/bin/mysqladmin -u root password mynewpassword
      >> /usr/bin/mysqladmin: connect to server at 'localhost' failed
      >> error: 'Access denied for user: 'root@localhost ' (Using password: NO)'[/color]
      >
      >This means that you tried to connect as root to set root's password, but
      > you specified no password. MySQL seems to want root's current
      >password before it'll let you do that.
      >
      >Sounds like you should contact the person who sold you this server, and
      >ask what is the current MySQL root password.
      >
      >Regards,
      >Bill K.[/color]

      xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxx
      Thank-you very much, Bill. You are a genius. Everything you
      said was right. I contacted the guy & he gave me the password.
      I am successfully logging in now, on my way to completing the
      objective of running source on the dump file, I'm sure. Here's
      some screen capture showing you what I've successfully been
      able to accomplish...

      Script started on Mon Mar 28 13:16:04 2005
      mlh@appserver mlh $ mysql
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 15 to server version: 4.0.22

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql> select user();
      +---------------+
      | user() |
      +---------------+
      | mlh@localhost|
      +---------------+
      1 row in set (0.00 sec)

      mysql> quit
      Bye
      mlh@appserver mlh $ mysql -u root -p
      Enter password:
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 16 to server version: 4.0.22

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql> select user();
      +----------------+
      | user() |
      +----------------+
      | root@localhost|
      +----------------+
      1 row in set (0.00 sec)

      mysql> quit
      Bye
      mlh@appserver mlh $ su dewey
      Password:
      dewey@appserver mlh $ mysql
      Welcome to the MySQL monitor. Commands end with ; or \g.
      Your MySQL connection id is 17 to server version: 4.0.22

      Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

      mysql> select user();
      +-----------------+
      | user() |
      +-----------------+
      | dewey@localhost |
      +-----------------+
      1 row in set (0.00 sec)

      mysql> quit
      Bye
      dewey@appserver mlh $ exit
      exit
      mlh@appserver mlh $ exit

      Script done on Mon Mar 28 13:24:24 2005

      ==> I am slightly confused about the return values from
      the two ANONYMOUS logins shown above. I would have
      expected the USER( ) function to return a name like
      anonymous@local host instead of mlh or dewey at localhost.
      Is that considered normal?


      Comment

      • Bill Karwin

        #4
        Re: I just ran /usr/bin/mysql_install_d b and it told me to set apassword for the MySQL root USER. I cannot.

        MLH wrote:[color=blue]
        > ==> I am slightly confused about the return values from
        > the two ANONYMOUS logins shown above. I would have
        > expected the USER( ) function to return a name like
        > anonymous@local host instead of mlh or dewey at localhost.
        > Is that considered normal?[/color]

        On Linux, yes. The "anonymous" login functionality allows you to
        connect without providing a password. MySQL detects your username as
        your Linux login, and the USER() function returns that string. MySQL
        "trusts" that you have been authenticated by the operating system if you
        got far enough to run the 'mysql' command.

        This isn't very reliable or secure by many people's standards, though.
        So for servers where security is considered important, one can disable
        anonymous logins on their MySQL installations.
        Read http://dev.mysql.com/doc/mysql/en/de...rivileges.html for more
        information on that topic.

        Regards,
        Bill K.

        Comment

        • Bill Karwin

          #5
          Re: I just ran /usr/bin/mysql_install_d b and it told me to set apassword for the MySQL root USER. I cannot.

          Bill Karwin wrote:[color=blue]
          > On Linux, yes. The "anonymous" login functionality allows you to
          > connect without providing a password.[/color]

          That's wrong. The anonymous login is not _necessarily_ passwordless,
          though that is the configuration that ships with the product.

          Sorry for the misinformation,
          Bill K.

          Comment

          • MLH

            #6
            Re: I just ran /usr/bin/mysql_install_d b and it told me to set a password for the MySQL root USER. I cannot.

            Misinformation that's now corrected. Who am I to complain?
            Thx for helping out In another thread, I'm addressing the issue
            of trying to telnet to the linux box over port 3306 (just to ensure
            that port 3306 is really workikng for me). ... until my linux server
            will respond to a command like
            this: telnet 192.168.1.106 3306
            I haven't got a snowball's chance of attaching to my mysql
            tables on that same linux server, right? I'm afraid I don't know
            how to configure the linux box to allow that, but that's a subject
            for another news group. Let me see what I can find out and I'll
            revisit this topic with this group after I can telnet in over port
            3306. Thx.

            xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx



            On Thu, 31 Mar 2005 10:00:36 -0800, Bill Karwin <bill@karwin.co m>
            wrote:
            [color=blue]
            >Bill Karwin wrote:[color=green]
            >> On Linux, yes. The "anonymous" login functionality allows you to
            >> connect without providing a password.[/color]
            >
            >That's wrong. The anonymous login is not _necessarily_ passwordless,
            >though that is the configuration that ships with the product.
            >
            >Sorry for the misinformation,
            >Bill K.[/color]

            Comment

            Working...