connect mysql terminal code example
Example 1: login to database mysql terminal
mysql -u USERNAME -p
Example 2: mysql terminal
mysql --user=user_name --password db_name
# Execute a script with logs:
mysql db_name < script.sql > output.tab
Example 3: how to connect mysql local server
\connect root@localhost:3306
Example 4: login to database mysql terminal
use DBNAME;
Example 5: login to database mysql terminal
show databases;