Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: install_driver(ODBC) mac mojave 10.14.2

by raventheone (Novice)
on Jan 21, 2019 at 19:06 UTC ( #1228775=note: print w/replies, xml ) Need Help??


in reply to Re^3: install_driver(ODBC) mac mojave 10.14.2
in thread install_driver(ODBC) mac mojave 10.14.2

cpan[3]> install DBD::ODBC DBD::ODBC is up to date (1.60). cpan[1]> look DBD::ODBC Reading '/Users/raventheone/.cpan/Metadata' Database was generated on Mon, 21 Jan 2019 01:54:44 GMT Running look for module 'DBD::ODBC' Trying to open a subshell in the build directory... Checksum for /Users/raventheone/.cpan/sources/authors/id/M/MJ/MJEVANS/ +DBD-ODBC-1.60.tar.gz ok Scanning cache /Users/raventheone/.cpan/build for sizes ...................................................................... +......DONE Working directory is /Users/raventheone/.cpan/build/DBD-ODBC-1.60-8omQ +Ke sh-3.2# perl Makefile.PL Looking for odbc_config in : nowhere Looking for odbc_config in (PATH) /Library/Frameworks/Python.framework +/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin Found odbc_config (via odbc_config) version 2.3.7 odbc_config reports --prefix=/usr/local/Cellar/unixodbc/2.3.7 odbc_config reports --include-prefix=/usr/local/Cellar/unixodbc/2.3. +7/include odbc_config reports --lib-prefix=/usr/local/Cellar/unixodbc/2.3.7/li +b ODBC INC dir set to /usr/local/Cellar/unixodbc/2.3.7/include via odb +c_config ODBC LIB dir set to /usr/local/Cellar/unixodbc/2.3.7/lib via odbc_co +nfig Using ODBCHOME /usr/local/Cellar/unixodbc/2.3.7 This looks like a unixodbc type of driver manager. Looking for odbcinst Found odbcinst in /usr/local/Cellar/unixodbc/2.3.7/bin odbcinst -j reports: unixODBC 2.3.7 DRIVERS............: /usr/local/etc/odbcinst.ini SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources USER DATA SOURCES..: /var/root/.odbc.ini SQLULEN Size.......: 8 SQLLEN Size........: 8 SQLSETPOSIROW Size.: 8 Please note these files as they are where you define your ODBC drivers + and data sources. Looking for odbc_config to get cflags Adding odbc_config --cflags "-DHAVE_UNISTD_H -DHAVE_PWD_H -DHAVE_SYS_T +YPES_H -DHAVE_LONG_LONG -DSIZEOF_LONG_INT=8 -I/usr/local/Cellar/unixo +dbc/2.3.7/include " to CC line Warning: LD_LIBRARY_PATH= doesn't include /usr/local/Cellar/unixodbc/2 +.3.7/lib Checking if your kit is complete... Looks good Multiple copies of Driver.xst found in: /Library/Perl/5.18/darwin-thre +ad-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.18/darwin-thr +ead-multi-2level/auto/DBI/ at Makefile.PL line 151. Using DBI 1.642 (for perl 5.018002 on darwin-thread-multi-2level) inst +alled in /Library/Perl/5.18/darwin-thread-multi-2level/auto/DBI/ Multiple copies of Driver.xst found in: /Library/Perl/5.18/darwin-thre +ad-multi-2level/auto/DBI/ /System/Library/Perl/Extras/5.18/darwin-thr +ead-multi-2level/auto/DBI/ at Makefile.PL line 1136. Using DBI 1.642 (for perl 5.018002 on darwin-thread-multi-2level) inst +alled in /Library/Perl/5.18/darwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::ODBC Writing MYMETA.yml and MYMETA.json Warning: not all required environment variables are set. Warning: Will not be able to run tests as you have not defined all of DBI_DSN, DBI_USER and DBI_PASS environment variables. sh-3.2# make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_h +arness(0, 'blib/lib', 'blib/arch')" t/*.t t/01base.t ................... ok t/02simple.t ................. skipped: DBI_DSN is undefined t/03dbatt.t .................. skipped: DBI_DSN is undefined t/05meth.t ................... skipped: DBI_DSN is undefined t/07bind.t ................... skipped: DBI_DSN is undefined t/08bind2.t .................. skipped: DBI_DSN is undefined t/09multi.t .................. skipped: DBI_DSN is undefined t/10handler.t ................ skipped: DBI_DSN is undefined t/12blob.t ................... skipped: DBI_DSN is undefined t/20SqlServer.t .............. skipped: DBI_DSN is undefined t/30Oracle.t ................. skipped: DBI_DSN is undefined t/40UnicodeRoundTrip.t ....... skipped: DBI_DSN is undefined t/41Unicode.t ................ skipped: DBI_DSN is undefined t/45_unicode_varchar.t ....... skipped: DBI_DSN is undefined t/50_odbc_utf8_on.t .......... skipped: DBI_DSN is undefined t/70execute_array_dbi.t ...... skipped: DBI_DSN is undefined t/70execute_array_native.t ... skipped: DBI_DSN is undefined t/80_odbc_diags.t ............ skipped: DBI_DSN is undefined t/82_table_info.t ............ skipped: DBI_DSN is undefined t/87_odbc_lob_read.t ......... skipped: DBI_DSN is undefined t/90_trace_flags.t ........... skipped: DBI_DSN is undefined t/odbc_describe_parameter.t .. skipped: DBI_DSN is undefined t/pod-coverage.t ............. 1/1 # Test::Pod::Coverage 1.04 required + for testing POD coverage t/pod-coverage.t ............. ok t/pod.t ...................... ok t/rt_101579.t ................ skipped: DBI_DSN is undefined t/rt_38977.t ................. skipped: DBI_DSN is undefined t/rt_39841.t ................. skipped: DBI_DSN is undefined t/rt_39897.t ................. skipped: DBI_DSN is undefined t/rt_43384.t ................. skipped: DBI_DSN is undefined t/rt_46597.t ................. skipped: DBI_DSN is undefined t/rt_50852.t ................. skipped: DBI_DSN is undefined t/rt_57957.t ................. skipped: DBI_DSN is undefined t/rt_59621.t ................. skipped: DBI_DSN is undefined t/rt_61370.t ................. skipped: DBI_DSN is undefined t/rt_62033.t ................. skipped: DBI_DSN is undefined t/rt_63550.t ................. skipped: DBI_DSN is undefined t/rt_78838.t ................. skipped: DBI_DSN is undefined t/rt_79190.t ................. skipped: DBI_DSN is undefined t/rt_79397.t ................. skipped: DBI_DSN is undefined t/rt_81911.t ................. skipped: DBI_DSN is undefined t/rt_null_nvarchar.t ......... skipped: DBI_DSN is undefined t/sql_type_cast.t ............ skipped: DBI_DSN is undefined All tests successful. Files=42, Tests=11, 1 wallclock secs ( 0.09 usr 0.07 sys + 0.97 cus +r 0.21 csys = 1.34 CPU) Result: PASS

how do i properly set the DBI_DSN?

Replies are listed 'Best First'.
Re^5: install_driver(ODBC) mac mojave 10.14.2
by Corion (Pope) on Jan 21, 2019 at 19:10 UTC

    Yay, you've compiled the stuff, so that's a first good step!

    The next step is to set up the DBI_ environment variables as documented in the DBI documentation. Likely, this is some database user, password and dbi:ODBC:some-odbc-dsn according to what you have available in your environment.

      i did this in terminal: export DBI_DSN=dbi:ODBC:<dbname> in the perlscript i use this (works under windows): my $myConnection = DBI->connect("dbi:ODBC:Driver={SQL Server};SERVER=< +db dsn>; database=<dbname>; PORT=<xxxx>;UID=$username;PWD=$password") or die "Error connection to databse $DBI::errstr"; if i execute it i get this: DBI connect('Driver={SQL Server};SERVER=db dsn>; database=<dbname>; PO +RT=<xxxx>;UID=<user>;PWD=<pw>','',...) failed: [unixODBC][Driver Mana +ger]Can't open lib 'SQL Server' : file not found (SQL-01000) at testp +erldb.pl line 10. Error connection to databse [unixODBC][Driver Manager]Can't open lib ' +SQL Server' : file not found (SQL-01000) at testperldb.pl line 10.

        "works under windows"

        You aren't doing this under windows :) . Check odbcinst.ini there should be a driver name, if this differs from 'SQL Server' use this. I think this should be documented somewhere in the unixodbc docs/driver pages.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1228775]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2019-11-19 22:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (96 votes). Check out past polls.

    Notices?