Lately I have been trying to do more of my database work from the command line instead of using tools like phpmyadmin or MySQL Workbench. Although I mainly enjoy frontend development sometimes it is nice to think databases...
I decided to list out a few simple commands to help me commit them to memory and also help anyone else who may stumble accross this.
Open MySql in terminal - For Mac Using MAMP
This command will fire up the Mamp Mysql Command line socket your a mac. You might have to adjust the path if your system is setup differently.
Remeber to make sure Mysql is running on your version of Mamp before you do this.
List All Databases
Will do just what it says and will show you a list of all the databases on your server.
Select A Database
Will select whatever database you specify.
Will show all the tables in your selected database.
View Database Structure
This shows the tables structure along with primary keys etc.
Does just what it says :)
Import Sql file
Just set your path and filename and you are away.