Ruby, as a powerful and flexible programming language, has been used by many programmers. They have gained great benefits in the use process. Today, we will introduce one of the following skills: Ruby's application skills for configuring Mysql DBI.
- Parse Json IN Ruby
- Ruby module Win32API calls win32API directly
- How to call win32ole IN Ruby
- Ruby basic code Experience Sharing
- Summary of several common Ruby core concepts
Configure Mysql DBI1 in Ruby.
First download DBI interface: http://rubyforge.org/frs/download.php/12368/dbi-0.1.1.tar.gz
It can be used in Windows. decompress the package and place it in the ruby directory, for example, C: \ ruby-dbi.
Configure Mysql DBI2 in Ruby, install the mysql dbi interface, and run the following command in C: \ ruby-dbi:
Ruby setup. rb config -- with = dbi, dbd_mysql // if you cannot use this command, run ruby setup. rb config -- with dbi and dbd_mysql;
Ruby setup. rb setup
Ruby setup. rb install
Configure Mysql DBI3 in Ruby and install the lib required by mysql:
Gem installmysql
After entering 2 in the prompt, you can see that the installation is successful.
Configure Mysql DBI4 and copy dll files to the Ruby directory in ruby:
Find libmySQL. dll in the mysql database directory and Copy it to the c: \ ruby \ bin directory.
Configure Mysql DBI5 in Ruby. The installation is complete and can be used.
The test code is as follows:
Require "dbi"
Thedbi = DBI. connect ("dbi: Mysql: test: localhost", "root ","")
If the execution is successful, mysql dbi is installed successfully.