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 --versionin 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
dpkginstallation, 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 updateto refresh your package list after adding the new repository. - πΎ Execute
sudo apt install mysql-serverto 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 mysqlto ensure it is active and running. - π Run
sudo mysql_secure_installationto 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 -pand enter the root password you set. - π Once logged in, you can use commands like
show databasesto view existing databases. - β Create a new database with
CREATE DATABASE <database_name>;. - πͺ Type
exitto 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