Skip to content

Instantly share code, notes, and snippets.

@alexislucena
Last active December 2, 2016 09:10
Show Gist options
  • Save alexislucena/7acf113f2509e44ebd469db5257f93ce to your computer and use it in GitHub Desktop.
Save alexislucena/7acf113f2509e44ebd469db5257f93ce to your computer and use it in GitHub Desktop.
Ubuntu: Install MySQL on Ubuntu 16.04

Update package index and packages:

$ sudo apt-get update
$ sudo apt-get upgrade

Install MySQL:

$ sudo apt-get install mysql-server

Set up MySQL:

$ sudo mysql_secure_installation

Check if MySQL is running:

$ systemctl status mysql.service

Log in as the root user:

$ mysql -u root -p

How to start/stop/restart MySQL:

$ sudo systemctl start/stop/restart mysql

How to check MySQL server version:

$ mysqladmin -p -u root version

https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-16-04
https://www.linode.com/docs/databases/mysql/install-mysql-on-ubuntu-14-04

How to install MySQL Workbench:

$ sudo apt-get update
$ sudo apt-get install mysql-workbench
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment