mySQL install Totally Botched on Ububntu

Discussion in 'MySQL' started by tonyrocks, Mar 20, 2009.

  1. #1
    Hey guys,

    I'm trying to totally remove/purge/barf out a botched mysql install. Why? because it keeps telling me that login denied for root@localhost everytime I type mysql.

    Anybody have this problem? I'm running it all on Ubuntu server...from shell...no desktop.

    :mad:
     
    tonyrocks, Mar 20, 2009 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    First see if you can login to mysql as root using a password.

    mysql -u root -p

    It will then ask you for a password. If you need to remove and reinstall, try using apt-get.

    apt-get remove mysql*

    This will remove mysql. You will then need to reinstall it and set a root password for security. You may need to install additional packages for usage on a web server. There are several mysql mackages and plugins that can be installed.

    apt-get install mysql-server php5-mysql (*optional)

    mysqladmin -u root password New_Password

    mysqladmin -u root -h localhost password New_Password

    Provided there weren't any errors, you should be able to login via:

    mysql -u root -p

    Also, just a personal note, you may not want to run a web server from an Ubuntu distro, if that's what you intend on doing. Ubuntu and Fedora and the other desktop replacements generally change too much, and aren't stable enough for servers. I would go with CentOS, or another more enterprise distro. This is a personal preference, but it's a pain in the A** when your OS goes end-of-life a few months after you installed it. If you're going to be doing ecommerce, or anything that may require long-term security, start with something very stable that isn't going to change a lot. Just a thought...
     
    jestep, Mar 21, 2009 IP
  3. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #3
    I suggest becoming a root first by typing su command then mysql
     
    crivion, Mar 22, 2009 IP