connect mysql command line ubuntu code example Example 1: open mysql in ubuntu terminal mysql -u root -p Example 2: ubuntu access database from terminal mysql -u USERNAME -p