Low Orbit Flux Logo 2 F

How To Access A MySQL Database

Accessing a MySQL database is easy. We are going to show you how it is done.

Update the repo:



sudo apt update

Install the client ( you might already have it ):



sudo apt install mysql-client

Connect to the database using the client.



mysql -u username -p -h hostname

Select the databae that you want to use:



USE mydb_1;

Query a table in the database:



SELECT * FROM example_table_1;

Exit the client:



EXIT;

Video Instructions