How to completely remove MYSQL on your localhost?

How to completely remove MYSQL on your localhost?
Photo by Markus Spiske on Unsplash

Sometimes, we thought a simple brew remove mysql will remove the entire MySQL but in some cases, it does not. Here is how you can completely remove MySQL on your mac locally.

  1. Open your terminal.

Shortcut tip: CMD + Space >> type “ter” >> press enter, terminal will popup.

2. Use mysqldump to backup your databases.

3. Stop MYSQL from running.

If you have a specific version for MYSQL you can run this.

4. Remove MYSQL.

5. Remove the remaining MYSQL files.

6. Unload MySQL login:

7. Remove MYSQL configuration. You can use nano or vim.

and remove this line below

8. Remove the MYSQL preferences.

You should have removed all the necessary files by now.

If you still face version or installation errors. You might want to kill the previous MySQL processes using the command below or restart your mac.

Kill the remaining MySQL process.

or

Check if all MYSQL processes are killed.

or check if the port 3306 is being used by any MYSQL process.

Kill the remaining MySQL process, if any.

I know some are eager to get this solved and get over with like myself…haha. So here is the quick shortcut to copy and paste on your terminal.

If you have a better or faster way to do this, do let me know in the comment below. Thanks, everyone!

--

--

I will follow you back. Entrepreneurship, React, Flutter, Firebase, Typescript, Javascript, NodeJS, ChatGPT, Crypto, Blockchain. Visit www.gamevsus.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Phong Yew Tong

I will follow you back. Entrepreneurship, React, Flutter, Firebase, Typescript, Javascript, NodeJS, ChatGPT, Crypto, Blockchain. Visit www.gamevsus.com