Last active
July 28, 2016 17:54
-
-
Save jmscholen/e4995b061d305cddf023ad2b8a7c6747 to your computer and use it in GitHub Desktop.
Setting up MySQL dB connection within Ruby Script and Rails app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'mysql' | |
@dbconfig = YAML.load(File.read('/home/dev/app/config/database.yml')) | |
@con = Mysql.new(@dbconfig["#{env}"]['host'], | |
@dbconfig["#{env}"]['username'], | |
@dbconfig["#{env}"]['password']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment