front and back-end web development, Leeds, UK


Richard's Blog - Design, coding and life in Japan

Richard

Databases

A bash script to download your remote MySQL schema and load it locally

#!/bin/bash
REMOTEUSER=username
REMOTEPASS=password
REMOTECOMPUTER=remotecomputer.com
REMOTEMYSQLUSER=mysqllogin
REMOTEMYSQLPASS=mysqlpass
DB=database
FILENAME=dbschema.sql
LOCALMYSQLUSER=localuser
LOCALMYSQLPASS=localpassword

ssh -l "$REMOTEUSER" "$REMOTECOMPUTER" "mysqldump -u$REMOTEMYSQLUSER -p$REMOTE

#!/bin/bash
REMOTEUSER=username
REMOTEPASS=password
REMOTECOMPUTER=remotecomputer.com
REMOTEMYSQLUSER=mysqllogin
REMOTEMYSQLPASS=mysqlpass
DB=database
FILENAME=dbschema.sql
LOCALMYSQLUSER=localuser
LOCALMYSQLPASS=localpassword

ssh -l "$REMOTEUSER" "$REMOTECOMPUTER" "mysqldump -u$REMOTEMYSQLUSER -p$REMOTEMYS
		           
Tags:

Using :include in Rails ActiveRecord call doesnt create a joins query

I am currently writing an Rails app that uses quite a few database calls. I wanted to cut these calls down so I knew I would need to use the :include option in ActiveRecord. I was expecting from what Ryan Bates mentioned in one of his RailsCasts that a nice join would be created for me in one query.

Tags:

SQLite3::SQLException: SQL logic error or missing database:

I found the following error in one of my unit tests

SQLite3::SQLException: SQL logic error or missing database: 

I had a quick look on google and found the following blog post

Tags:

Recent Blog Posts

Syndicate content