sudo apt updatesudo apt install mysql-server -ymysql --versionExpected output: mysql Ver 8.0.45-0ubuntu0.24.04.1 for Linux on x86_64 ((Ubuntu))
sudo systemctl start mysqlsudo systemctl stop mysqlsudo systemctl restart mysqlsudo systemctl status mysqlsudo systemctl enable mysqlRun the security setup:
sudo mysql_secure_installationRecommended options:
- Set root password → Yes
- Remove anonymous users → Yes
- Disallow remote root login → Yes
- Remove test database → Yes
- Reload privilege tables → Yes
sudo yum install mysql-serveror
sudo dnf install mysql-serverDownload installer from: MySQL Community Downloads.
Install:
- MySQL Server
- MySQL Workbench (recommended GUI)
- MySQL Shell
Using Homebrew:
brew install mysqlStart service:
brew services start mysqlsudo mysqlor
mysql -u root -pEXIT();