SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Rhode Island, USA
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    I have a small problem with my MySQL server.

    I have recently installed the MySQL onto my Cobalt RaQ server, however, I can't access it. I don't know the username or the password to it... although I've tried to set the passwood to root by using the comands I've listed below it didn't work.

    bash$ mysql -u root mysql
    mysql> UPDATE user SET Password=PASSWORD('my_new_pass');

    ERROR REPLY:
    ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)

    OR...

    bash$ mysqladmin -u root password my_new_pass

    ERROR REPLY:
    mysqladmin: connect to server at 'localhost' failed
    error: 'Access denied for user: 'root@localhost' (Using password: NO)'


    Does anyone have any suggestions? Any way I can reset the server/passwords... there are no databases to be lost.

    Thanks for your time,
    Alex.

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you use the pkg from Cobalt (http://pkg.nl.cobalt.com/), the default root password is 'cobalt-mysql'.

  3. #3
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wouldn't you want to set the password for root
    UPDATE user SET Password=PASSWORD('my_new_pass') WHERE Username = 'root';

    Just a thought! Because your query wasn't updating any record.

    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  4. #4
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I heard that if you were logged in as root, you could just type "mysql -u root -p" in bash and then type the new password, it should be okay.. not to sure though (not had time to test).

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Rhode Island, USA
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Freddie (freddydoesphp) I've tried putting your suggested command and this is what happened:

    bash$ mysql
    mysql> UPDATE user SET Password=PASSWORD('my_new_pass') WHERE Username='root';
    ERROR 1046: No Database Selected

    PeterW, I've tried your first suggestions, of using the password of "cobalt-mysql" and the responce I've got was:

    ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)

    In fact my attempts with these suggestions where answered with a "denied", and "Using password: YES."

    Should I uninstall MySQL by using the .pkg file from Cobalt? If so, how would I uninstall the other MySQL on the server already, that I've had installed manually?

    Or could I install the .pkg hoping it would over write the old MySQL installed?

    Thanks for your help,
    Alex.

  6. #6
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as uninstalling, I dont think it should be necessary.

    Here is something that might interest you..

    Code:
          Message 3269 of 4086         [ Reply ]  [ Forward ]  [ View Source ]       
     
      
    
    From: Cathal Garvey  <me@c...>
    Date: Fri Dec 1, 2000 00:17am
    Subject: RAQFAQ Resetting Unknown MySQL Root Password
    
    
    Resetting Unknown MySQL Root Password
    
    Assumptions:
    ------------
    Logged in as root on the machine that hosts the MySQL DB Server
    MySQL is installed!
    
    Disclaimer:
    -----------
    These are notes made by me using a routine that worked for me - nothing
    more, nothing less - use at your own risk!
    
    Procedure:
    ----------
    
    1. Shut down server (if running)
    The best way to do this is locate the lock file of the running MySQL server
    process. This will be called after your raq's name, not including the
    domain. To find this out look at your prompt or type "cat /etc/HOSTNAME".
    The bit we want is the first bit (before the first '.' in the name!). So for
    example a raq called http://www.abc.com, the lock file we want will be called
    http://www.pid. Now look for the lock file - typical places are
    /usr/local/mysql/data or /usr/local/var. If you cant find it try typing
    "find / -name http://www.pid 2>/dev/null" and see if that finds it.
    
    If we have located the lock file type "kill `cat /path/to/www.pid`"
    (omitting the double quotes, replacing the file path with whatever it really
    is and leave the ` characters there!!).
    
    If we cant find the lock file or the last command gives an error try typing
    "p mysql" which should produce a list of 3 or more. Ignore any entries in
    the list that look like "grep mysql". If the list is empty (bar the "grep
    mysql"), mysql is not running. If its not empty, look for the process id of
    the last entry (bar "grep mysql" if its there) in the list (2nd column) and
    type "kill 1234" where 1234 is that process id. Type "p mysql" again to see
    if the list is still there. If it is keep killing the last entry until the
    list is empty - but usually it will be empty after the "first kill"!
    
    2. Start server by-passing permissions
    Look for the server file name "mysqld". It might be in
    /usr/local/libexec/mysqld or /usr/local/mysql/bin/mysqld. If you have
    trouble finding it try typing "find / -name mysqld 2>/dev/null" which should
    find it! Type "/usr/local/mysql/mysqld --skip-grant-tables &" where
    /usr/local/mysql/mysqld is where you found mysqld.
    
    3. Connect to MySQL
    Type "mysql -u root mysql" to connect to MySQL.
    
    4. Change Password
    ** WARNING: This assumes you are using the default security settings and
    have not tweaked them to your own use. If you have or are in doubt please
    read MySQL documentation about this step **
    
    At the "mysql>" prompt type "update user set Password=PASSWORD('newpwd')
    where User='root';". Leave out the double quotes but leave in the single
    quotes & semi-colon. "newpwd" is the new password you want for root. You
    might want to be a bit more concise and use "update user set
    Password=PASSWORD('newpwd') where User='root' and Host='localhost';".
    
    Now type "FLUSH PRIVILEGES;" to enforce the new privileges throughout the
    database(s).
    
    5. Restart MySQL in normal mode again
    Follow the steps in Step 1 to shutdown the MySQL server again. Then type
    "/usr/local/mysql/bin/safe_mysqld &" to start the server back in safe/normal
    mode. You should now be able to use "mysql -u root -p" and provide the new
    password when prompted to connect again!

  7. #7
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    bash$ mysql
    mysql> UPDATE user SET Password=PASSWORD('my_new_pass') WHERE Username='root';
    ERROR 1046: No Database Selected
    From this, it seems like MySQL is working perfectly! You just need to select a database before you can issue an UPDATE command. In this case, you want to use the 'mysql' database:

    mysql> USE mysql;

    mysql> UPDATE user SET Password=PASSWORD('my_new_pass') WHERE Username='root';
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  8. #8
    SitePoint Enthusiast
    Join Date
    May 2000
    Location
    Rhode Island, USA
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well,

    Thank you for your suggestions Kevin and Peter.

    This is what I've tried -- but still failed -- to do. I've shut down the server manually, and then tried to get it back up and put a new password in... However, after that I couldn't get it back up either manually or by rebooting the server.

    Therefore, is there easy way I could delete MySQL, and then have my cobalt server install the MySQL .pkg ... I've had mine installed manually which is why it causes so many troubles for me.

    (I've already tried installing the MySQL .pkg ... however, It says there is an error. It is most likely because I haven't deleted the old MySQL installation.)

    Thank you for your time,
    Alex.

  9. #9
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    I don't have the experience with Cobalt servers to advise you. Anyone else? Easy karma up for grabs...
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  10. #10
    SitePoint Evangelist
    Join Date
    Jul 2000
    Location
    Warwickshire, England
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I assume it would only be a case of tracking down all the files and knocking 'em on the head.
    I actually only use PostGreSQL on my server, so I cant really tell you where all the files are.. plus it will vary on your config..
    Here is how I would go about it.. if you choose to follow some of the instructions here, you can; if you do, anything will be on your head, not mine!
    First stop the mysql server, delete the start script in /etc/rc.d/init.d
    I think it would be safer from now on just to rename files etc.
    Try doing a "whereis mysql" to see if you can find the mysql dir.
    -- rename the directories, or delete them.. it is upto you, but the pkg install may fail if it finds any of the mysql files.
    next use find to locate mysql* files.. delete/rename files as needed.
    etc etc etc until you rid your system of all needed mysql files..

    The only thing that makes me think you may have to delete all the files is..
    "If you have made an attempt to install MySQL by other means, remove all traces of it before installing this package. This will not upgrade a prior installation of MySQL." - from the cobalt site...


    The other solution would be of course to try and get your current installation working?


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
  •