Ruby experience in configuring Mysql DBI

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.