Monday, January 27, 2020

Install MySQL on MAC and import Chinook DB


  1. Download mysql binaries from https://dev.mysql.com/downloads/mysql/
  2. Download mysql workbench from https://dev.mysql.com/downloads/workbench/
  3. Install mysql software by executing the downloaded mysql dmg binaries
  4. Reset password by navigating to System preferences -> mysql  (root as user)
  5. Edit .bash_profile and add the following Line and save
    cd /Users/rajanimaski
    Pwd
    Open .bash_profile
    export PATH=${PATH}:/usr/local/mysql/bin/
  6. Reopen terminal window
  7. Enter mysql and this should connect to mysql terminal
  8. open mysql workbench 
  9. Connect to localhost with root as user and given password

Commands
Show databases
Create database chinook;
Use chinook;
Show tables;

Via terminal

mysql -u root -p chinook --binary-mode -o
source /Users/rajanimaski/Datasets/ChinookDatabase/ChinookDatabase/DataSources/Chinook_MySql.sql

source /Users/rajanimaski/Datasets/ChinookDatabase/ChinookDatabase/DataSources/Chinook_MySql_AutoIncrementPKs.sql




References