
# stata_path=/Applications/Stata/StataSE.app/Contents/MacOS/StataSE Stata_path=/Applications/Stata/StataIC.app/Contents/MacOS/StataIC # odbc_lib_path=/opt/homebrew/lib/:/opt/homebrew/mariadb-connector-odbc/ Odbc_lib_path=/usr/local/Cellar/:/usr/local/Cellar/mariadb-connector-odbc/ # Configure LD_LIBRARY_PATH for Apple Silicon or Intel-based Macs: # Note: SSH tunnel will be terminated on exiting Stata. # Configure `remote_user`, `remote_host`, `odbc_lib_path` and `stata_path` # Creates SSH tunnel between Mac/UNIX-based OS in background, and runs Stata. # Final note: To kill SSH connection once finished, use: Odbc load, exec( "select * from mytable ") clear dsn( " ") # Authenticate connection to DB: # Via: File | Import | ODBC data sources # or: By setting `password` keyword/value in DSN # Test loading date, e.g., Applications/Stata/StataIC.app/Contents/MacOS/StataIC & # Note, possible alternative Stata install locations: # - /Applications/Stata/StataSE.app/Contents/MacOS/StataSE # - /Applications/Stata/StataMP.app/Contents/MacOS/StataMP # Set ODBC driver manager set odbcmgr unixodbc, permanently Applications/Stata/StataIC.app/Contents/MacOS/StataIC & # On Intel-based Macs export LD_LIBRARY_PATH=/usr/local/Cellar/:/usr/local/Cellar/mariadb-connector-odbc/ & \

# Launch Stata: # On Apple Silicon Macs export LD_LIBRARY_PATH=/opt/homebrew/lib/:/opt/homebrew/mariadb-connector-odbc/ & \ # Download, install and configure ODBC Manager, from: # Add new DB driver: # Driver Name: MariaDB ODBC 3.1 Driver # Driver File: /opt/homebrew/Cellar/mariadb-connector-odbc/3.1.15/lib/mariadb/libmaodbc.dylib # or: /usr/local/Cellar/mariadb-connector-odbc/3.1.15/lib/mariadb/libmaodbc.dylib # Add Data Source Name (DSN) for each remote db to be connected to: # 1) Under 'User DSN', choose 'Add.' to add a new data source # 2) Select the 'MariaDB ODBC 3.1 Driver' # 3) Enter a Data Source Name (DSN) (recommend to use same as remote DB name) # 4) Configure the DSN, with the following keyword/values: # SERVER: localhost # PORT: 3307 # CHARSET: utf8 # DATABASE: # USER: # Create ssh connection to DB server:

bin/bash -c " $(curl -fsSL ) " # Install unixodbc.
