Find the answer to your Linux question:
Results 1 to 10 of 10
ok, i installed the ff: version() | +-----------------+ | 4.0.17-standard | MySQL-server MySQL-client MySQL-devel MySQL-shared i tried: mysqladmin -u root password <new-password> it's ok. then: mysqladmin -u root -h <hostname> ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User
    Join Date
    Aug 2003
    Posts
    289

    MySQL weird install


    ok, i installed the ff:

    version() |
    +-----------------+
    | 4.0.17-standard |


    MySQL-server
    MySQL-client
    MySQL-devel
    MySQL-shared

    i tried:
    mysqladmin -u root password <new-password>
    it's ok.
    then:
    mysqladmin -u root -h <hostname> password <new-password>
    i get an this error:

    mysqladmin: connect to server at <host> failed
    error: 'Host <host> is not allowed to connect to this MySQL server'

    the weird thing is, as root, i can't even run mysql. root is being denied for cyring out loud! but when i run mysql using non-root user i get in.

    so i try to see what default databases are there;

    show databases;

    i only get 'test' as a result. isn't there supposed to be a mysql default database where some tables containing permissions are placed? i can create tables using this account.

    wassup with this? did i forget to install something else?
    Registered User #345074

  2. #2
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284

    Re: MySQL weird install

    if you have set a password for the root user, you then need to specify that password when connecting to the database, eg, if you want the mysql> prompt to work with the db:

    Code:
    mysql -h <host> -u root -p<password>
    (there is NO space between -p and the password). or just specify -p then it will prompt you for the password.

    It is worth pointing out that "root" can only connect to the database from "localhost" by default.

    The additional mysql database you are talking about is only accessable to the root user, or users with "GRANT" privilages IIRC.

    Once you've logged in as root, add another user that you can use to work with:
    http://www.mysql.com/doc/en/Adding_users.html

    Jason

  3. #3
    Linux User
    Join Date
    Aug 2003
    Posts
    289
    that's exactly my problem. i can't even get in as root. i'm being denied access to connect to the mysql server. so how can i grant or add users without using root? what's funny is that i can seem to get into mysql monitor as regular user.
    Registered User #345074

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    and your definatly trying to log in from localhost, ie you have a shell on the mysql server, then your typing
    Code:
    mysql -h localhost -u root -p
    ?


    If your sure, then consider resetting the root mysql password: http://www.mysql.com/doc/en/Resetting_permissions.html

    You can add users without being root, only if you have been issued grant privilages when your user was created.

    Jason

  6. #5
    Linux User
    Join Date
    Aug 2003
    Posts
    289
    i've reinstalled and didn't set the root password. still it doesn't lemme in. would there be probable conflicts if you have 2 hostnames listed on your hosts file? coz i have 2 hosts but i'm not using the localhost default.

    i've also tried that line you said, it doesn't work.. .
    Registered User #345074

  7. #6
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    Quote Originally Posted by xylex_blaiste
    i've reinstalled and didn't set the root password. still it doesn't lemme in. would there be probable conflicts if you have 2 hostnames listed on your hosts file? coz i have 2 hosts but i'm not using the localhost default.

    i've also tried that line you said, it doesn't work.. .
    I'll put it another way. When you connect to the server with the root user, if you specify a host ("-h <hostname>") which is NOT localhost it will NOT let you in.

    Can you copy / paste what you are typing, and what error message it returns?

    Ta,

    Jason

  8. #7
    Linux User
    Join Date
    Aug 2003
    Posts
    289
    i uninstalled all for now. wait, lemme try that install one more time and figure out what's wrong. if it still doesn't work, then i'll show you the error messages i'm getting. thanks dude!
    Registered User #345074

  9. #8
    Linux User
    Join Date
    Aug 2003
    Posts
    289
    ok, everything is perfect now! thanks to all who helped.. .
    Registered User #345074

  10. #9
    Linux User
    Join Date
    May 2003
    Location
    CA
    Posts
    370
    could you please tell us the cause/solution?
    Fixing Unix is better than working with Windows.
    http://nikhilk.homedns.org/projects/index.html

  11. #10
    Linux User
    Join Date
    Aug 2003
    Posts
    289
    i'm not sure about what really happened. it would be embarassing to say it here but what the heck. it was simple, and maybe i was just being stupid. this is what happens when one doesn't read much before doing something. i know that in linux, you have to read and read and read a lot of things.

    so, anyway, i downloaded mysqlcc coz it would be easier to grant privileges and add users through it. with the previous install where i set a root password through mysqladmin, i couldn't connect with mysqlcc as root, even if i typed in the correct password. so i just reinstalled the whole MySQL RPMs, fired up mysqlcc, granted all privileges to all for both my regular account and root. then all went well.

    the thing is that, when you finish mysql-server install, it tells you to set the root password. it doesn't prompt you. it's just a reminder. i did this right after the install:

    1.) mysqladmin -u root password <new password>
    2.) mysqladmin -u root -h <host> password <new password>

    i did this but couldn't get to the 2nd part though.

    this was my mistake. but i don't know if this is always the case.
    Registered User #345074

Posting Permissions

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