Log into your Maria Database Account

 

To log into your Maria Database account, you must first get the username and password of your Maria Database account from your instructor. You then need to log into one of the Linux computers in the WEB Lab with your Linux account.  After logging in to your Linux account, at the command prompt type in this command to login to your Maria Database account:

 

mysql -h 146.245.252.140 -u your username -p

 

    Then press enter, and it will ask you for your Maria Database password. Type the password in and press enter. The cursor will not move when you type the password in. Here is an example. Make sure there is a space after mysql, after -h, after the IP address of the Maria Database server, after -u and after your Maria Database username.

mysql -h 146.245.252.140 -u tbrone -p

 

Maria Database SQL Commands and Examples

 

use : Connect to your database. You should connect to your database before creating tables or running any other  database operations. Your database name is your maria database username with and underscore db attached, example,  use joe_db;

create table: example, create table dogs(name varchar(20), breed varchar(20), age int);

show columns from table: example, show columns from dogs;

insert into table(data)values(data): example, insert into dogs(name,breed,age)values('snowball','maltese','10');

select: example, select * from dogs;

 

See internet for more examples