Skip to main content

How to Install MySQL on Ubuntu Linux Using the Official APT Repository

HardReset.InfoJanuary 8, 20269 min22 views
10 connections·14 entities in this video→

Checking for Existing MySQL Installation

  • πŸ” Check if MySQL is already installed on your system by typing mysql --version in the terminal.

Adding the MySQL APT Repository

  • 🌐 Navigate to the official MySQL website and find the download page for the MySQL APT repository.
  • ⬇️ Download the MySQL APT configuration package.
  • πŸ“¦ Use the sudo dpkg -i <package_name.deb> command in the terminal to add the repository to your system's software sources.
  • βš™οΈ During the dpkg installation, you may be prompted to select the MySQL server version and connector options; the default selections are generally suitable.

Installing MySQL Server

  • πŸ”„ Run sudo apt update to refresh your package list after adding the new repository.
  • πŸ’Ύ Execute sudo apt install mysql-server to install the MySQL server.
  • πŸ”‘ You will be prompted to set a root password during installation; choose a strong password for production environments.

Verifying and Securing MySQL

  • βœ… Check the status of the MySQL service with sudo systemctl status mysql to ensure it is active and running.
  • πŸ”’ Run sudo mysql_secure_installation to perform basic security hardening, which includes options to set the root password (if not done during installation), remove anonymous users, disable remote root login, and remove test databases.

Accessing MySQL

  • πŸ”‘ Log into MySQL using sudo mysql -u root -p and enter the root password you set.
  • πŸ“Š Once logged in, you can use commands like show databases to view existing databases.
  • βž• Create a new database with CREATE DATABASE <database_name>;.
  • πŸšͺ Type exit to quit the MySQL client.
Knowledge graph14 entities Β· 10 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
14 entities
Chapters4 moments

Key Moments

Transcript35 segments

Full Transcript

Topics10 themes

What’s Discussed

MySQLUbuntuLinuxAPT repositoryMySQL ServerTerminal CommandsDatabase InstallationSystemctlMysql_secure_installationRoot Password
Smart Objects14 Β· 10 links
ProductsΒ· 6
PeopleΒ· 2
LocationΒ· 1
MediasΒ· 3
ConceptsΒ· 2