How Do I Uninstall And Reinstall MySQL? - DigitalOcean

  • Blog
  • Docs
  • Get Support
  • Contact Sales
  • Tutorials
  • Questions
  • Product Docs
  • Cloud Chats
  • Search Community

Report this

What is the reason for this report?This undefined is spamThis undefined is offensiveThis undefined is off-topicThis undefined is otherSubmit<- Back to questionsQuestionHow do I uninstall and reinstall MySQL?Posted on January 24, 2017MySQLUbuntu 16.04macmikeal

By macmikeal

Popular topics

I did an install of Ubuntu 16.04 Server. I installed LAMP as I did the install. I set a password for MySQL at the time. I did an install of wordpress and tried to run it and got an error message can’t connect with the database. I went into command line and MySQL is not starting up. States can’t log in with Password NO. I didn’t set NO as password. So I assume I need to uninstall MySQL and reinstall so I can put my correct password in. Any help ideas appreciated.

Submit answer (3)Add a comment (0)

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to AnswerThese answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.0kotrakrishnakotrakrishnaJune 30, 2017Show less

Thanks. This helped

apt-get purge -y mysql-* Reply0Jonathan TittleJonathan TittleJanuary 24, 2017Show less

@macmikeal

Before you remove your MySQL installation, try running the following command from the CLI.

mysql_secure_installation

If a password hasn’t been set for root (for MySQL), that’ll prompt you to set a password and run you through a series of steps to help clean up and secure MySQL (basic security).

Once set, then try running the command below to restart MySQL and see if you receive an error.

service mysql restart

We can troubleshoot to see what the issue is, as long as I know what errors you’re receiving, or we can wipe the installation and start from scratch.

To remove MySQL, first you’d want to run:

apt-get remove -y mysql-*

and then:

apt-get purge -y mysql-*

The first command removes MySQL and associated packages while the second wipes configuration.

Reply0macmikealmacmikealJanuary 24, 2017Show less

What I found out so far is I can’t log in as root or do anything requiring the root password. So I have got to get the Servers password to somethig I know. I even tried to log in as root from the server itself. I am gong to also need to know how to set up the database Wordpress wants. I realize that is once I can get MySQL to start which it currently will not. So as I see my steps. 1. Get the root password set to something I know. 2. Get MySQL password to what is currently in wpconfig file. 3. Make sure the database Wordpress needs is right. Any help will sure be appreciated.

ReplyLoad more answers

Popular Topics

  1. AI/ML
  2. Ubuntu
  3. Linux Basics
  4. JavaScript
  5. Python
  6. MySQL
  7. Docker
  8. Kubernetes
  9. All tutorials
  10. Talk to an expert
  • All tutorials
  • All topic tags

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Sign Up

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Learn more

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Learn more

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

SubmitSubmit

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

View all products

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

Get started

*This promotional offer applies to new accounts only.

© 2025 DigitalOcean, LLC.Sitemap.

Tag » How To Reinstall Mysql 8