Skip to content

Instantly share code, notes, and snippets.

@JamesDaniel
Last active June 24, 2021 18:09
Embed
What would you like to do?

How to install mysql on ubuntu (which works)

first delete it in case a root password was previously created:

sudo apt-get purge mysql-server mysql-client mysql-common mysql-server-core-5.5 mysql-client-core-5.5
sudo rm -rf /etc/mysql /var/lib/mysql
sudo apt-get autoremove
sudo apt-get autoclean

then install it:

then start up the mysql command line:

mysql -u root -p

Create a user:

CREATE USER 'user' IDENTIFIED BY 'mypass';

Then grant privileges:

GRANT ALL PRIVILEGES ON * . * TO 'user'

Then create a database:

CREATE DATABASE dbname;

Or use a database:

USE dbname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment