[MySQL]: Note

SQL

09/18/2019


Command line for MySQL

BASH
mysql-ctl start # Start mySQL server
mysql-ctl stop # Stop mySQL server
mysql-ctl cli # Restart mySQl server & open up CommandLineInterface
# Alternative (alias)
sudo service mysql start # Start mysql service
# Same as mysql-ctl start
sudo service mysql stop
mysql # Start mySql
# Same as mysql-ctl cli

In MySQL shell

BASH
mysql> exit # Exit out of mySQL shell
mysql> ctrl + C # ALso exit
mysql> source <path>/fileName.sql # Run sql file
# absolute path or path from where you start 'mysql' command

WRITTEN BY

Keeping a record