DEV Community

Cover image for Installing MySQL and MySQL Workbench on Linux
Dhanraj K
Dhanraj K

Posted on • Originally published at Medium

1 2

Installing MySQL and MySQL Workbench on Linux

Simple Guideline on installing MySQL and Workbench on Ubuntu , Pop_OS or any Debian Linux.

Install MySQL

Update apt to ensure you get the latest packages and install mysql-server

$ sudo apt-get update
$ sudo apt-get install mysql-server

Next to setup and Configure MySQL

$ sudo mysql_secure_installation

Selecting Y ('yes') for all the setting is reasonabe.

To access MySQL

$ sudo mysql -u root -p

Install MySQL Workbench

Download the installer which is compatable for your system and Linux version .

click here to download

Just click on the deb file and install or use dpkg command to install

$ sudo dpkg -i path_to_deb_file

To Uninstall MySQL and MySQL Workbench

If u want to remove both this softwares completely from your system use the following commands

To remove MySQL

$ sudo apt-get remove --purge mysql-server mysql-client mysql-common -y
$ sudo apt-get autoremove -y
$ sudo apt-get autoclean

To remove MySQL Workbench

$ sudo apt-get remove mysql-workbench-community
or
$ sudo dpkg -r mysql-workbench-community
$ sudo dpkg --purge mysql-workbench-community

To Start, Stop, Restart or check Status of MySQL Service

$ sudo service mysql start 
$ sudo service mysql stop
$ sudo service mysql restart
$ sudo service mysql status

To Access MySQL without SUDO

When we try to access MySQL without sudo ERROR 1045 (28000): Access denied for user 'username'@'localhost' (using password: NO)

this error pops up

Follow this steps to overcome this error

$ sudo mysql  -u root -p
Enter password:
mysql> show databases;
mysql> use mysql
mysql> select user, host, plugin from mysql.user;
mysql> update user set plugin="mysql_native_password" where User="root";
mysql> flush privileges;
mysql> exit;
$ mysql -u root
mysql> SET GLOBAL validate_password.policy=LOW;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Enter_password';
mysql> exit
$ sudo service mysql restart

now we can access MySQL by using

$ mysql  -u root -p

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil — patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Latest comments (1)

Collapse
 
arvindsridharan profile image
arvindsridharan

Awesome post. Most of the times it gets time to get started with mysql installation, especially with the password bit and port number.

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video 🎥

👋 Kindness is contagious

Dive into this insightful write-up, celebrated within the collaborative DEV Community. Developers at any stage are invited to contribute and elevate our shared skills.

A simple "thank you" can boost someone’s spirits—leave your kudos in the comments!

On DEV, exchanging ideas fuels progress and deepens our connections. If this post helped you, a brief note of thanks goes a long way.

Okay