Skip to content
TekTinkers

TekTinkers

Learning and imagination unlock limitless possibilities in technology

  • TinkersLab
    • TinkersDocs
    • Garage LAN
    • HomeLab
  • Resources
    • Events
  • Minecraft
    • Minecraft Technologies
    • Server Tools ‘n Stuff
    • TinkersCraft
  • About
    • Education
    • Experience-Awards
    • Special Thanks
    • Volunteer-Charity
  • Toggle search form

Commands to setup MySQL server and more

Posted on June 17, 2025June 17, 2025 By TekTinkers
Installing MySQL
  • sudo apt install mysql-server
  • sudo mysql

change “root” and “password” to whatever you want

  • ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;
  • exit
  • sudo mysql_secure_installation
MySQL: Creating Users and Databases
  • sudo mysql -u root -p

Change “example_database”, “example_user” and “password” to whatever you want:

  • CREATE DATABASE example_database;
  • CREATE USER ‘example_user’@’%’ IDENTIFIED BY ‘password’;

OPTIONAL – Change password of users:

  • ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘password’;
  • GRANT ALL ON example_database.* TO ‘example_user’@’%’;
  • exit
Delete a Database
  • DROP DATABASE database_name;

Linux, TinkersLab Tags:linux, mysql

Post navigation

Previous Post: Setup a LAMP server in Ubuntu
Next Post: Setup WordPress

Copyright © 2025 TekTinkers - Images by CoPilot, unedited for the lol's