ubuntu access database from terminal

C++
mysql -u USERNAME -p
Source

Also in C++: