It’s interesting because I have always been drawn to understanding the big picture of things, and back when I first shifted to IT, I was intrigued with working with databases (and left me feeling dissatisfied with solely front-end stuff). I’m circling back to that, now, as I continue my Linux journey, and I find myself still interested in understanding this!
First we have to start the MySQL service, like I did earlier with the Apache2 server:
$ service mysql start
// then logging in, including authentication
$ mysql -u root -p // password input follows
This would be >mysql -u root -p (IP address) if the database is being hosted on a network elsewhere
(! Woohoo! we are connected! )
Let’s see the status of users and passwords:
mysql>select user, host, password from mysql.user;
// when I tried this, no passwords were set
Now, let’s see what databases are available, and select one to work with:
mysql> show databases;
// returns a few databases, including 'mysql'
mysql> use mysql;
// this command connects us to the 'mysql' database