MySQL Command Line Examples

Command to log into remote host with username and password.

mysql --user=[username] --password=[password]--host=[computer]

Example:

mysql --user=root --password=mypassword--host=VMYSQL01

Show Databases

show databases;

Run script

mysql --user=root --password=mypassword --database=DB1< myscript.sql

No votes yet