Learn about example perl script to connect to oracle database, we have the largest and most updated example perl script to connect to oracle database information on alibabacloud.com
Using DBI, Perl makes it easy to connect to the MySQL database:
The code is as follows:
Copy Code code as follows:
#!/bin/perl
Use DBI;
# Connect to Target DBMy $dbh = Dbi->connect ("Dbi:mysql:database=eygle;host=l
mysql client command line to create a table for SQL query.Mysql> Create Table users (ID int (4) primary key, username varchar (25), country varchar (2 ));Query OK, 0 rows affected (0.11 Sec)Mysql> insert into users values (1, 'john', 'in'), (2, 'Tom ', 'us'), (3, 'layla ', 'us ');Query OK, 3 rows affected (0.11 Sec)Records: 3 duplicates: 0 Warnings: 0Once a table is created, use the DBI method to create a Script Template (see table ).Table#! /Bin/
Exp_p.sh #! Binsh #$1 generate dmp file storage path if [-d $1]; thenecho $1 exist # create a file name based on the user name and password on the current day
Exp_p.sh #! /Bin/sh #$1 generate the dmp file storage path if [-d $1]; then echo $1 exist # generate the file name based on the user name/password on the current day
Exp_p.sh
#! /Bin/sh
#$1 generate the storage path of the dmp File
If [-d "$1"]; then
Echo "" $1 "exist"
# The user name/password generated file name is automatical
The following describes how to use perl to connect to the MySQL database, including how to correctly install the module.,The following is a description of the MySQL database module on CPAN. I hope you will have a deeper impression on it after reading it.
I used activeperl to learn
Use dbi to connect to the mysql database using perl. By using DBI, Perl can easily connect to the mysql database: the code is as follows: Copy the code as follows :#! BinperluseDBI; # ConnecttotargetDBmy $ dbhDBI-
Open the ODBC data source (32-bit) in the control panel, find the user data source list in the user DSN column, select a row named "MSAccess97Database", and press "configure.
This article teaches you how to connect to the Access database under Perl.
1. install the Win32-ODBC module
Step 1:
Download win32-odbc.zip from the toolsbar and use winzip to unbind it to
By using DBI, you can easily connect to the MySQL database using Perl:
The code is as follows:Copy the Code code as follows:#!/bin/perl
Use DBI;
# Connect to Target DBMy $dbh = Dbi->connect ("Dbi:mysql:database=eygle;host=localho
Using Perl to connect to the Mysql database website back-end database to Mysql makes it much easier to use Perl to connect to the database.
Through DBI,
The website's back-end database is converted to MySQL. Now it is much easier to connect to the database using Perl.
Through DBI, Perl can easily connect to the database:
#! /Bin/
This article describes how to use perl to connect to a mysql database through dbi. For more information about how to use DBI, use Perl to easily connect to a mysql database:
The code is as follows:
The code is as follows:
#!
Web site backend database to MySQL, now use Perl to connect the database is much more convenient.
The Dbi,perl makes it easy to connect to a database:
#!/bin/
By using DBI, Perl can easily connect to the mysql database:
The Code is as follows:Copy codeThe Code is as follows:#! /Bin/perl
Use DBI;
# Connect to target DBMy $ dbh = DBI-> connect ("DBI: mysql:
Linux is not specifically designed for MSSQL access to the library, but between the MSSQL is derived from Sybase, so access to Sybase's library can naturally access Mssql,freetds is such a realization.Perl typically uses DBI to access the database, so after the system has FreeTDS installed, you can use DBI to access the MSSQL database via FreeTDS, for example:
First you need to installPPM Install Dbd::mysql UseStrict; UseDBI;my $host="localhost";#Host Addressmy $driver="MySQL";#interface type defaults to localhostmy $database="Runoob";#handle to the database # driver Objectmy $dsn="DBI: $driver:d atabase= $database: $host"; my $userid="Root";#Database user namemy $password="
The first step is to install the WIN32-ODBC module, which is as follows:
1: Download the win32-odbc.zip from the Tools column, download the WinZip to a temp directory after downloading, a total of three files:
Readme
Win32-odbc.ppd
Win32-odbc.tar.gz
2: Under the DOS window, run the following DOS command in the TEMP directory: ppm install WIN32-ODBC.PPD.
Then prepare the test database (Access)
1: Start Ms ACCESS, create a new empty
The 1.NAVICAT connection data configuration information is as follows:Click on the "OK" button to go to the softwareFollow the sequence of steps drawn in the diagram, and finally restart Navicat.On the inside of this folder instantclient_11_2, there is not clear to see me write another piece of article:Address: http://www.cnblogs.com/haoke/archive/2012/10/22/2734392.htmlReference URL: http://wiki.navicat.com/wiki/index.php/Instant_client_required"Navicat Con
Note: When connecting using the database specified by the SID, the database is not specified in the connection.
#!/usr/bin/perl use strict;
Use warnings;
Use DBI;
My $db _name= "geneva_admin";
My $db _passwd= "geneva_admin"; My $dbh =dbi->connect ("Dbi:oracle:", "$db _name", "$db _passwd") or Die "Can" T
1. Download Databaselibrary2. Install an Oracle support library: cx_oracleWindows can download the. exe to install, this library is: https://pypi.python.org/pypi/cx_Oraclehttps://pypi.python.org/pypi/cx_OracleThe number of bits to download is the same as the number of Python bits, I download the 64-bit, (Cx_oracle-5.1.2-py2.7.egg-info), the cx_oracle version is 11g, download finished directly after installation3. dllWe don't necessarily need to have t
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.