Get the App
SLTechnology News&Howtos  ›  Development  › 

Steps for Ruby to configure Mysql DBI

Shulou Source: shulou.com Published: 2022-06-03 13:12:11 09月21日 Update

This article mainly explains "the steps of configuring Mysql DBI in Ruby". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the steps of configuring Mysql DBI with Ruby.

Ruby configuration Mysql DBI1, preparation work.

First download the DBI interface: http://rubyforge.org/frs/download.php/12368/dbi-0.1.1.tar.gz

The same can be used under Windows. Decompress it and put it in the ruby directory, such as C:\ ruby\ ruby-dbi.

Ruby configure Mysql DBI2, install the mysql dbi interface, and run the following command under C:\ ruby\ ruby-dbi:

Ruby setup.rb config-- with=dbi,dbd_mysql / / if this command does not work, use ruby setup.rb config-- with dbi,dbd_mysql to run

Ruby setup.rb setup

Ruby setup.rb install

Ruby configures Mysql DBI3 and installs the lib required by mysql:

Gem installmysql

After entering 2 at the prompt, you can see that the installation is successful.

Ruby configure Mysql DBI4 and copy dll files to the ruby directory:

Find libmySQL.dll,Copy in the mysql database directory to the c:\ ruby\ bin directory.

Ruby configures Mysql DBI5. 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.

At this point, I believe that you have a deeper understanding of the "Ruby configuration Mysql DBI steps", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Configuration directories steps success content commands interfaces learning running no practical deeper code interest practicality practical simple operation data database files Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS MariaDB vpn Apple Shulou Technology