MySQL (cloud)
We are using mysql as a persistence layer for our application. In short this is where the data is store.
Make sure that the service is up and running by typing this command in the console:
1
sudo service mysql status
Copied!
mysql status

Configuring a new user

Connect to the database service using the root user and add new credentials for the application
1
sudo mysql -u root
Copied!
In the example below replace username and password with the desired credentials. Make sure you will remember them.
1
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
Copied!
Then grant the required privileges to access all the databases.
1
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION;
Copied!
In order to exit the mysql console type exit and press enter.

Connecting to the mysql server

Run the following command with the newly created credentials.
1
mysql -u username -p
Copied!
You will be prompted to type the password, but no characters will be displayed. Press enter to connect

Creating a new database

1
CREATE DATABASE database_name;
Copied!
To list all the databases type the following command:
1
SHOW DATABASES;
Copied!
002-show-databases

Getting back to the linux console

Type exit