MySQL Server Install on Ubuntu Server: Difference between revisions

From Joey's Wiki
Jump to navigation Jump to search
(Created page with "This guide shows how to install and setup MySQL server on Ubuntu Server. ==Installation== Update/Upgrade any pending packages sudo apt update sudo apt upgrade Install MySQL Server sudo apt install mysql-server Category: Homelab")
 
No edit summary
Line 1: Line 1:
This guide shows how to install and setup MySQL server on Ubuntu Server.
This guide shows how to install and set up MySQL server on Ubuntu Server.


==Installation==
==Installation==
Line 12: Line 12:


  sudo apt install mysql-server
  sudo apt install mysql-server
==Configuration==
Log into the SQL server as root by running
sudo MySQL
Create a new user, where 'password' is your password
CREATE USER 'joey'@'localhost' IDENTIFIED BY 'password';
Output should look like <code>Query OK, 0 rows affected (0.01 sec)</code>
Edit the password if needed later
ALTER USER 'joey'@'localhost' IDENTIFIED  BY 'new_password';
Next, grant privileges as needed (this example grants ALL privileges so use sparingly)
GRANT ALL PRIVILEGES ON *.* TO 'joey'@'localhost' WITH GRANT OPTION;


[[Category: Homelab]]
[[Category: Homelab]]

Revision as of 18:35, 15 November 2024

This guide shows how to install and set up MySQL server on Ubuntu Server.

Installation

Update/Upgrade any pending packages

sudo apt update
sudo apt upgrade

Install MySQL Server

sudo apt install mysql-server

Configuration

Log into the SQL server as root by running

sudo MySQL

Create a new user, where 'password' is your password

CREATE USER 'joey'@'localhost' IDENTIFIED BY 'password';

Output should look like Query OK, 0 rows affected (0.01 sec)

Edit the password if needed later

ALTER USER 'joey'@'localhost' IDENTIFIED  BY 'new_password';

Next, grant privileges as needed (this example grants ALL privileges so use sparingly)

GRANT ALL PRIVILEGES ON *.* TO 'joey'@'localhost' WITH GRANT OPTION;