Skip to content

Instantly share code, notes, and snippets.

@samazgor
Created November 30, 2022 09:06
Show Gist options
  • Save samazgor/98ca5d3d4576d9a2c0697d239d14f83b to your computer and use it in GitHub Desktop.
Save samazgor/98ca5d3d4576d9a2c0697d239d14f83b to your computer and use it in GitHub Desktop.
Create MySQL DB and User

Login to SSH and then sudo mysql -u root -p

Hit enter, by default there's no password.

CREATE DATABASE db_name;

CREATE USER 'db_user' IDENTIFIED BY 'STRONG_PASSWORD';

GRANT ALL PRIVILEGES ON db_name.* TO 'db_user';

FLUSH PRIVILEGES;

EXIT;

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