Giter Club home page Giter Club logo

homebrew-mssql-release's Introduction

homebrew-mssql-release's People

Contributors

abhisheksinha89 avatar bakerwho avatar bmitchinson avatar david-engel avatar davidjb avatar meet-bhagdev avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar v-artcho avatar v-chojas avatar v-sutso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebrew-mssql-release's Issues

Redistributable?

Is the Microsoft ODBC driver 17 for SQL Server on macOS (& Linux) redistributable? The license file mentions distributing:

2. DISTRIBUTABLE CODE. The software may contain code you are permitted to
   distribute (i.e. make available for third parties) in applications you develop,
   as described in this Section.

   a) Distribution Rights. The code and test files described below are
      distributable if included with the software.

      i. REDIST.TXT Files. You may copy and distribute the object code form
         of code listed on the REDIST list in the software, if any, or listed at REDIST;

      ...

But there isn't a REDIST.TXT file list.

Could not connect to Azure SQL Database on version 17.8.1.1

Description

We have an Azure SQL Database running and a Python script connecting to it using pyodbc / msodbcsql17 / mssql-tools

Latter two have been installed via brew, without any version specified, and run on a Microsoft hosted agent macOS-10.15

The following approach was used to install the related driver on the agent, detailed by this doc page:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools

We have been getting the following error when trying to connect to the database with this connection string:

  • Connection string:

    • DRIVER={ODBC Driver 17 for SQL Server};SERVER=tcp:<db-host>;DATABASE=<db-name>;UID=<db-user-name>;PWD=<db-user-password>;
  • Error message:

    • OperationalError: ('08001', '[08001] [Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection (0) (SQLDriverConnect)')

Attempted fixes

We have tried a few solutions, but without success:

  • Minimum TLS Version on all of 1.0, 1.1, 1.2
  • Installing previous versions of msodbcsql17 / mssql-tools

Successful workaround

  • Symlinking /usr/local/Cellar/[email protected]/1.1.1l to openssl instead of the current 3.0 version

Is msodbcsql connect() on macOS not thread-safe?

I have running Python + pyodbc + msodbcsql on my macOS.
And I have encountered segmentation fault on several times.

I created following reproduction code. This become always segmentation fault on my environment.

import threading

import pyodbc


def task():
    connection_string = (
        'DRIVER={ODBC Driver 17 for SQL Server};'
        'SERVER={127.0.0.1};'
        'UID={sa};'
        'PWD={...}'
    )
    conn = pyodbc.connect(connection_string)
    conn.execute("SELECT 1")
    conn.close()


def main():
    threads = []
    for i in range(100):
        thread = threading.Thread(target=task)
        thread.start()
        threads.append(thread)

    for thread in threads:
        thread.join()


if __name__ == '__main__':
    main()
$ python3 repro.py
Segmentation fault: 11

Environment

macOS version

macOS Mojave 10.14.3 (18D109)

Homebrew installation version

microsoft/mssql-release/msodbcsql17: stable 17.3.1.1
unixodbc: stable 2.3.7 (bottled)

Python version

Python3 installed with homebrew.

Python 3.7.2 (default, Feb 12 2019, 08:15:36)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin

pyodbc version

pyodbc==4.0.27b1

Stack trace

Thread 17 Crashed:
0   ???                           	0x000000010e567ddb 0 + 4535516635
1   ???                           	0x000000010e518952 0 + 4535191890
2   ???                           	0x000000010e5259df 0 + 4535245279
3   org.python.python             	0x000000010dfc4668 _PyMethodDef_RawFastCallKeywords + 545
4   org.python.python             	0x000000010dfc3bd3 _PyCFunction_FastCallKeywords + 44
5   org.python.python             	0x000000010e0595f0 call_function + 636
6   org.python.python             	0x000000010e052231 _PyEval_EvalFrameDefault + 7016
7   org.python.python             	0x000000010dfc3fae function_code_fastcall + 112
8   org.python.python             	0x000000010e052548 _PyEval_EvalFrameDefault + 7807
9   org.python.python             	0x000000010dfc3fae function_code_fastcall + 112
10  org.python.python             	0x000000010e059665 call_function + 753
11  org.python.python             	0x000000010e052218 _PyEval_EvalFrameDefault + 6991
12  org.python.python             	0x000000010dfc3fae function_code_fastcall + 112
13  org.python.python             	0x000000010e059665 call_function + 753
14  org.python.python             	0x000000010e052218 _PyEval_EvalFrameDefault + 6991
15  org.python.python             	0x000000010dfc3fae function_code_fastcall + 112
16  org.python.python             	0x000000010dfc4931 _PyObject_Call_Prepend + 150
17  org.python.python             	0x000000010dfc3ce1 PyObject_Call + 136
18  org.python.python             	0x000000010e0c0eee t_bootstrap + 71
19  org.python.python             	0x000000010e087847 pythread_wrapper + 25
20  libsystem_pthread.dylib       	0x00007fff6c44e305 _pthread_body + 126
21  libsystem_pthread.dylib       	0x00007fff6c45126f _pthread_start + 70
22  libsystem_pthread.dylib       	0x00007fff6c44d415 thread_start + 13

Note

I also tried with pyodbc commenting-out Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS and built by my own.

Then it works properly (It runs without error).

https://github.com/mkleehammer/pyodbc/blob/36e79af13da09ae9514b010ed445b0a4df306fab/src/connection.cpp#L113-L115

Cannot install

I followed the instruction at:
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017

and the last step does not seem to work:
piotrs-macbook-pro:Roxi-RTG poznan$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Frameworks
/usr/local/sbin
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
piotrs-macbook-pro:Roxi-RTG poznan$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/Frameworks
/usr/local/sbin
==> The Xcode Command Line Tools will be installed.

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/Frameworks /usr/local/sbin
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/Frameworks /usr/local/sbin
==> /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
==> /usr/bin/sudo /usr/sbin/chown poznan /usr/local/Frameworks /usr/local/sbin
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local/Frameworks /usr/local/sbin
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew
==> /usr/bin/sudo /bin/chmod g+rwx /Library/Caches/Homebrew
==> /usr/bin/sudo /usr/sbin/chown poznan /Library/Caches/Homebrew
==> Searching online for the Command Line Tools
==> /usr/bin/sudo /usr/bin/touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode-9.4
==> /usr/bin/sudo /usr/sbin/softwareupdate -i Command\ Line\ Tools\ (macOS\ High\ Sierra\ version\ 10.13)\ for\ Xcode-9.4
Software Update Tool

Downloading Command Line Tools (macOS High Sierra version 10.13) for Xcode
Downloaded Command Line Tools (macOS High Sierra version 10.13) for Xcode
Installing Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done with Command Line Tools (macOS High Sierra version 10.13) for Xcode
Done.
==> /usr/bin/sudo /bin/rm -f /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
==> /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools
==> Downloading and installing Homebrew...
remote: Counting objects: 1904, done.
remote: Compressing objects: 100% (565/565), done.
remote: Total 1904 (delta 1495), reused 1698 (delta 1310), pack-reused 0
Receiving objects: 100% (1904/1904), 298.48 KiB | 1.59 MiB/s, done.
Resolving deltas: 100% (1495/1495), completed with 312 local objects.
From https://github.com/Homebrew/brew
5d4adead0..c9aa25e6d master -> origin/master
HEAD is now at c9aa25e6d Merge pull request #4722 from kabel/remove-chdir-twice
==> Cleaning up /Library/Caches/Homebrew...
==> Migrating /Library/Caches/Homebrew to /Users/poznan/Library/Caches/Homebrew...
==> Deleting /Library/Caches/Homebrew...
Already up-to-date.
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics.html

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations
==> Next steps:

  • Run brew help to get started
  • Further documentation:
    https://docs.brew.sh
    piotrs-macbook-pro:Roxi-RTG poznan$ brew update
    Already up-to-date.
    piotrs-macbook-pro:Roxi-RTG poznan$ brew install --no-sandbox msodbcsql17 mssql-tools
    Error: No available formula with the name "msodbcsql17"
    ==> Searching for a previously deleted formula (in the last month)...
    Warning: homebrew/core is shallow clone. To get complete history run:
    git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.piotrs-macbook-pro:Roxi-RTG poznan$ brew search odbc
==> Formulae
libiodbc mariadb-connector-odbc psqlodbc sqliteodbc unixodbc

==> Casks
actual-odbc-pack cloudera-impala-odbc hortonworks-hive-odbc mongodb-compass-community
cloudera-hive-odbc filemaker-odbc mongodb-compass mongodb-compass-readonly

License issue

Hi,

Looking to redistribute msodbcsql (for free) inside a software stack built with this Homebrew tap. However, the applicable license restricts distribution of the software to non-Windows platforms:

2.	ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
a.	Distributable Code.
...
iii.	Distribution Restrictions. You may not
...
•	distribute Distributable Code to run on a platform other than the Windows platform;

That wording seems to even negate distribution via this Homebrew tap.

Please advise whether this license can be changed, or another may be used. Feel free to contact me directly.

msodbcsql license attached for reference: LICENSE.txt

[Driver Manager]Can't open lib file not found (0) Apple M1

Installed ODBC and msodbcsql mssql-tools all through brew on native ARM64 M1 Mac, install proceeds fine but it can't seem to find libmsodbcsql.17.dylib

I've tried symbolic linking to the /etc/ home-brew path like in the documents, and also changing the path inside the ini file to exactly the libmsodbcsql.17.dylib file.
Chmod 777 the file and I still get this error:

[unixODBC][Driver Manager]Can't open lib '/opt/homebrew/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)"

/opt/homebrew/lib/ being the new Brew folder for M1 Macs

Edit:
/opt/homebrew/lib/libmsodbcsql.17.dylib -> ../Cellar/msodbcsql17/17.6.1.1/lib/libmsodbcsql.17.dylib

Can't get MSSQL/Pyodbc to work in brand new Macbook Pro

So I've combed through the issues here.

I followed microsoft's documentation to install on a brand new M1 Macbook pro. I am trying to connect through pyodbc in visual studio code and am at a loss on what to try out next. I am pretty stumped as I had a macbook air M1 that I had set up with this same framework (that unfortunately died on me).

When I attempt the following call in VScode:
conn = pyodbc.connect(server = 'xxx', database = 'xxx', user = 'xxx', password = 'xxx', port=xxx, driver='ODBC Driver 17 for SQL Server')

I receive the error:

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found (0) (SQLDriverConnect)")

I have installed from a non-rosetta terminal.

To get ahead of some of the suggestions I've seen in closed issues:

oodbcinst -j returns:

unixODBC 2.3.9
DRIVERS............: /opt/homebrew/etc/odbcinst.ini
SYSTEM DATA SOURCES: /opt/homebrew/etc/odbc.ini
FILE DATA SOURCES..: /opt/homebrew/etc/ODBCDataSources
USER DATA SOURCES..: /Users/ethan.harrison/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8


which isql returns:

/opt/homebrew/bin/isql

Would sincerely appreciate any help as I am just completely at a loss to what to do/try next!

[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]

Hi,

We're seeing this error on a macOS machine that was recently upgraded to BigSur.

With DYLD_PRINT_LIBRARIES=1 on we get the following output when running isql.

dyld: loaded: <F1D86644-8FA4-358B-BF7F-8C8ECDB26946> /usr/local/opt/openssl/lib/libssl.dylib
dyld: loaded: <D2B61D80-F7E0-38B9-A78A-FAA58F5F9B75> /usr/local/Cellar/openssl@3/3.0.0/lib/libcrypto.3.dylib
[08001][Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: [OpenSSL library could not be loaded, make sure OpenSSL 1.0 or 1.1 is installed]
[08001][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection

We're using version 17.8.1.1.

We've tried brew uninstall msodbcsql17 mssql-tools and then following the macOS install instructions, but with no success. When installing with brew, its dependencies are listed as [email protected], but even if it does need version 1 not sure how to re-point it, as it looks hardcoded path-wise.

I had the same error.

I had the same error.
When you brew install msodbcsql17 mssql-tools, it also installs openssl and by default it refers to openssl@3, however you need [email protected].
You can install 1.1 and change the symbolic link

brew install [email protected]

# you might need to delete the old symlink first
# rm /usr/local/opt/openssl

ln -s /usr/local/Cellar/[email protected]/1.1.1l /usr/local/opt/openssl

For future reference, you might need to change directory accordingly. Currently the latest version of openssl 1.1 is 1.1.1l

Using MacOS Monterey, and this worked. Couldn't understand why it wasn't working as had been following the above comments, but then noticed the new updated version of [email protected] was now available, so had been incorrectly specifying the directory with 1.1.1m. Once changed to 1.1.1l it worked.

Originally posted by @jh88 in #59 (comment)

Warning: Calling <<-EOS.undent is deprecated!

Filing from a comment here:
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server

Swabips 5 hours ago
I get this error when updating on OS X High Sierra:

Warning: Calling <<-EOS.undent is deprecated!
Use <<~EOS instead.
/usr/local/Homebrew/Library/Taps/microsoft/homebrew-msodbcsql/Formula/msodbcsql.rb:16:in `caveats'
Please report this to the microsoft/msodbcsql tap!

How do I fix this to update?

Custom openssl location

It appears libmsodbcql tries to dynamically load openssl from /usr/local/opt/openssl/lib . Is it possible to override this location?

macOS version of libmsodbcsql.17.dylib in msodbcsql-17.8.1.1 appears to want to load libodbcinst.2.dylib in /opt/homebrew/lib instead of /usr/local/lib

Hi,

thanks for the ARM64 version of the driver. It's much appreciated.

I've noticed a difference in the path to the libodbcinst.2.dylib library that the msodbcsql-17.8.1.1 driver is linked to:

% otool -L /path/to/msodbcsql-17.8.1.1/lib/libmsodbcsql.17.dylib
/path/to/msodbcsql-17.8.1.1/lib/libmsodbcsql.17.dylib:
	libmsodbcsql.17.dylib (compatibility version 0.0.1, current version 8.1.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1770.255.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)
	/opt/homebrew/lib/libodbcinst.2.dylib (compatibility version 3.0.0, current version 3.0.0)
	/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 904.4.0)

and see that it wants to load /opt/homebrew/lib/libodbcinst.2.dylib whereas the previous version msodbcsql-17.7.2.1 is linked to:

% otool -L /path/to/msodbcsql-17.7.2.1/lib/libmsodbcsql.17.dylib 
/path/to/msodbcsql-17.7.2.1/lib/libmsodbcsql.17.dylib:
	libmsodbcsql.17.dylib (compatibility version 0.0.1, current version 7.2.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1259.11.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
	/usr/local/lib/libodbcinst.2.dylib (compatibility version 3.0.0, current version 3.0.0)
	/System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos (compatibility version 5.0.0, current version 6.0.0)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.1.0)

and see that it wants to load /usr/local/lib/libodbcinst.2.dylib.

So is this change correct? Is libodbcinst.2.dylib now supposed to be in /opt/homebrew/lib ?

Thank you.

Unattended installation

I've attempted to install msodbcsql17 unattended, but it fails and kills the installation job:

Do you accept the license terms? (Enter YES or NO)
Error: An exception occurred within a child process:
  NoMethodError: undefined method `chomp' for nil:NilClass

The first time it failed, I looked at the brew formula and thought that I had taken care of it by additionally providing environment variable ACCEPT_EULA=Y. As I'm sure you're aware (though I wasn't), brew now additionally requires HOMEBREW_NO_ENV_FILTERING=1 in order for that to work.

The doc at Installing the Microsoft ODBC Driver for SQL Server on Linux and macOS amusingly provides examples for Linux that include ACCEPT_EULA=Y, but the MacOS example does not. Could the docs be changed such that the examples have parity between platforms? For example, MacOS could become "HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools".

Or, failing that, could the brew formula be changed so that it makes reference to the need for HOMEBREW_NO_ENV_FILTERING=1? Or, failing that, a link to this comment would be helpful to others needing to do this in the future. :)

Oh, and I forgot to initially mention it, but your error handling for the session not being interactive appears not to work, given the quoted error output above.

MacOS infinite loop EULA prompt

On macOS 10.11 and 10.12

Run

brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update

Then calling

ACCEPT_EULA=Y brew install --no-sandbox msodbcsql mssql-tools

does not remove the prompt to accept the EULA. Calling

yes | ACCEPT_EULA=Y brew install --no-sandbox msodbcsql mssql-tools

causes the prompt to loop indefinitely because only YES or NO is accepted at the prompt. Setting the ACCEPT_EULA environment variable does not appear to have any effect.

Since this problem first occurred on 12/11 after the nightly builds, we suspect a homebrew-core update from a few hours later may have something to do with it.

Why is 'caveat' required?

This extract from the installation 'formula' below is confusing. My question is what is a formula 'uninstall'? The formula doesn't include an 'uninstall' method and the 'caveat' suggests using the same uninstall command as the 'install' method. So won't the former always fail because the 'install' method has already taken the action suggested by the 'caveat' ?

  def install
    return false unless check_eula_acceptance?

    chmod 0444, "lib/libmsodbcsql.17.dylib"
    chmod 0444, "share/msodbcsql17/resources/en_US/msodbcsqlr17.rll"
    chmod 0644, "include/msodbcsql17/msodbcsql.h"
    chmod 0644, "odbcinst.ini"
    chmod 0644, "share/doc/msodbcsql17/LICENSE.txt"
    chmod 0644, "share/doc/msodbcsql17/RELEASE_NOTES"

    cp_r ".", prefix.to_s

    if build.with? "registration"
      system "odbcinst", "-u", "-d", "-n", "\"ODBC Driver 17 for SQL Server\"".  <=========
      system "odbcinst", "-i", "-d", "-f", "./odbcinst.ini"
    end
  end

  def caveats; <<~EOS
    If you installed this formula with the registration option (default), you'll
    need to manually remove [ODBC Driver 17 for SQL Server] section from
    odbcinst.ini after the formula is uninstalled. This can be done by executing
    the following command:
        odbcinst -u -d -n "ODBC Driver 17 for SQL Server" <=========
    EOS
  end

Install fails for mssql-tools on msodbcsql dependency; empty .ini files?

I cannot seem to brew install these tools on macOS 10.12.6.

The failure occurs here: https://github.com/Microsoft/homebrew-mssql-release/blob/master/Formula/msodbcsql.rb#L54-L55

It looks like ( but i'm not sure I really understand ) this command tries to 'deregister' the odbc driver version, but it hasn't been installed/registered yet, so it fails. The .ini files that odbcinst seems built to interact with are empty. See details that follow...

Steps to reproduce:

| => brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
| => brew update
Already up-to-date.
| => brew install --no-sandbox mssql-tools
==> Installing mssql-tools from microsoft/mssql-release
==> Installing dependencies for microsoft/mssql-release/mssql-tools: msodbcsql17
==> Installing microsoft/mssql-release/mssql-tools dependency: msodbcsql17
==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48
Already downloaded: /Users/eric.adams/Library/Caches/Homebrew/msodbcsql17-17.1.0.1.tar.gz
The license terms for this product can be downloaded from
https://aka.ms/odbc170eula and found in
/usr/local/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)
YES
==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
Last 15 lines from /Users/eric.adams/Library/Logs/Homebrew/msodbcsql17/01.odbcinst:
2018-05-14 13:12:34 -0500

odbcinst
-u
-d
-n
"ODBC Driver 17 for SQL Server"

odbcinst: SQLRemoveDriver failed with Unable to find component name.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/microsoft/homebrew-mssql-release/issues

Clues as to cause:

| => du /usr/local/Cellar/unixodbc/2.3.6/.bottle/etc/odbcinst.ini
0	/usr/local/Cellar/unixodbc/2.3.6/.bottle/etc/odbcinst.ini

| => du  /usr/local/Cellar/unixodbc/2.3.6/.bottle/etc/odbc.ini
0	/usr/local/Cellar/unixodbc/2.3.6/.bottle/etc/odbc.ini

odbcinst: SQLInstallDriverEx failed with Invalid install path.

Some days ago, my Mac OS 10.14 got some problem with ODBC SQL Server driver (before runs fine).

Now, shows in Python this message ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib '/usr/local/lib/libmsodbcsql.13.dylib'. I tested the library and exists in the path.

I tried to reinstall drivers (both 13 and 17) and the command microsoft/mssql-release/[email protected] returns odbcinst: SQLInstallDriverEx failed with Invalid install path.

Same issue for brew install msodbcsql17

I need some help. Tks

Problem with macOs 10.15

Hi, I have upgraded my macBook Pro to Catalina(10.15), from there onwards sql drivers not working properly.

I am using

  • CodeIgnitor 3.1.1 framework
  • PHP 7.3.10

Fatal error: sqlsrv_fetch_array: Unknown exception caught. in /Users/bhupalasuresh/Sites/sqlconnect/system/database/drivers/sqlsrv/sqlsrv_result.php on line 175

BCP strange behavior on mac 10.15.7

Hello, I am working on a mac (non m1) and testing the bcp functionality and noticing some odd behavior. I have used this utility almost daily on my windows machine and have not observed these issues.

In windows, everything needs to be perfect for the command to work, otherwise the error file is filled with information. I'm noticing that the mac version of BCP seems to take whatever I have and force it into the table and almost never puts info into the error file. I suspect user error but am not sure.

The file i am working with is a comma separated .txt file and the command I am running is

bcp sqlTest.dbo.z_testing IN "tests/data_for_bcp.txt" -S sqlinstance24 -T -c -b 50000 -t "," -e "tests/bcp_test_error_file.txt" -F2

The text file has headers on the first row, hence the "F2" option. The table I am directing the data into only has one column whereas the data_for_bcp.txt file has three columns. When using this command in windows, I would expect this to fail given that the text file and destination table don't have compatible columns, however, on mac, this command runs without any errors. Upon inspecting the output table, I see that an entire row from the text file is inserted into the 1 column in the destination table. This behavior makes me think that the delimiter flag isn't working as intended.

I have tried changing the delimiter in both the text file as well as in the bcp command and have continued to notice the same behavior.

The raw data looks like this:
image

The data inserted into the sql table looks like this:
image

Any info would be greatly appreciated!

locale issue in msodbcsql17

I found locale issue on msodbcsql17.

Following python code causes critical error.
It is happen on shared library. So it cannot catch on python error handling.

import pyodbc
pyodbc.connect(driver='{ODBC Driver 17 for SQL Server}', ...)
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for C/en_US.UTF-8/C/C/C/C
Abort trap: 6

I wrote the detail here: mkleehammer/pyodbc#399

This error is not happen on msodbcsql13.
It seems to be happen on following haskell on macOS too. fpco/odbc#17

So I think this is not pyodbc issue. I think this is msodbcsql17 issue.

sqlcmd does not accept queries from standard input

Per the issue here: mtxr/SublimeText-SQLTools#120 the sqlcmd command does not seem to accept queries from the stdin approach, by piping the query into the command or otherwise.
The simple test that was performed was:

echo "select 1;" | sqlcmd -S "serverorIP,port" -U "username" -P "password" -d "database"

It returns:

Sqlcmd: Warning: The last operation was terminated because the user pressed CTRL+C.

I realize that this is the github repo for the homebrew installer for sqlcmd, however it appears that the maintainer of the sqlcmd CLI is the poster of this installer as well.

Trap 6 Error connecting with PyODBC and wrong username or password

I am using MacOS Monterey 12.01, updated Homebrew to the latest of today, and I was getting a Trap 6 error upon execution of conn=pyodbc.connect(Driver). I then enabled SQL Tracing and found that there was a problem with the credentials. As soon as I replaced with the proper ones it worked like a charm.

However as it should not crash by a failed authentication I am adding the issue here including the trace file contents with sensitive information replaced for obvious reasons.

[ODBC][74949][1636450416.854237][__handles.c][460]
Exit:[SQL_SUCCESS]
Environment = 0x7fe785e06e00
[ODBC][74949][1636450416.854638][SQLSetEnvAttr.c][189]
Entry:
Environment = 0x7fe785e06e00
Attribute = SQL_ATTR_ODBC_VERSION
Value = 0x3
StrLen = 4
[ODBC][74949][1636450416.854841][SQLSetEnvAttr.c][381]
Exit:[SQL_SUCCESS]
[ODBC][74949][1636450416.855030][SQLAllocHandle.c][377]
Entry:
Handle Type = 2
Input Handle = 0x7fe785e06e00
UNICODE Using encoding ASCII 'UTF-8' and UNICODE 'UCS-2-INTERNAL'

[ODBC][74949][1636450416.855401][SQLAllocHandle.c][513]
Exit:[SQL_SUCCESS]
Output Handle = 0x7fe785e3d600
[ODBC][74949][1636450416.857144][SQLDriverConnectW.c][290]
Entry:
Connection = 0x7fe785e3d600
Window Hdl = 0x0
Str In = [DRIVER={ODBC Driver 17 for SQL Server};SERVER=10.xxx.yyy.zzz,1433;DATABASE=DBNAME;UID=UserName;PWD=][length = 108 (SQL_NTS)]
Str Out = 0x0
Str Out Max = 0
Str Out Ptr = 0x0
Completion = 0
[ODBC][74949][1636450417.043445][__handles.c][460]
Exit:[SQL_SUCCESS]
Environment = 0x7fe785e3c600
[ODBC][74949][1636450417.044276][SQLGetEnvAttr.c][157]
Entry:
Environment = 0x7fe785e3c600
Attribute = 65002
Value = 0x7ff7bdfa82b0
Buffer Len = 128
StrLen = 0x7ff7bdfa8294
[ODBC][74949][1636450417.044441][SQLGetEnvAttr.c][273]
Exit:[SQL_SUCCESS]
[ODBC][74949][1636450417.044596][SQLFreeHandle.c][220]
Entry:
Handle Type = 1
Input Handle = 0x7fe785e3c600
[ODBC][74949][1636450417.046198][SQLDriverConnectW.c][699]
Exit:[SQL_ERROR]
[ODBC][74949][1636450417.046368][SQLDriverConnect.c][748]
Entry:
Connection = 0x7fe785e3d600
Window Hdl = 0x0
Str In = [DRIVER={ODBC Driver 17 for SQL Server};SERVER=10.xxx.yyy.zzz,1433;DATABASE=DBNAME;UID=UserName;PWD=
][length = 108 (SQL_NTS)]
Str Out = 0x7ff7bdfa8c70
Str Out Max = 2048
Str Out Ptr = 0x0
Completion = 0
DIAG [28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'UserName'.

	DIAG [42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot open database "DBNAME" requested by the login. The login failed.

Continued issues with locale on MacOS

Hi,

Me again digging up an old issue (see #18 and #25).

Per #25 I thought 17.3 was to include a fix for the locale issues. I have version 17.3.1.1 installed, with the latest (v5.6.1) pdo_sqlsrv driver for PHP.

My application is able to perform GET, PATCH, and DELETE requests to the database without any issues. However, when sending a POST request the driver still seems to be crashing with the following error:

terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for en_US.UTF-8/en_US.UTF-8/en_GB.UTF-8/en_US.UTF-8/en_GB.UTF-8/en_US.UTF-8

I tried doing some of the same things as before, as far as explicitly setting the locale in my application, but it resulted in the same type of error.

I'm not sure what other information would be helpful to provide, but I'm happy to do any troubleshooting.

Thanks

raise ImproperlyConfigured("Error loading pyodbc module: %s" % e) django.core.exceptions.ImproperlyConfigured: Error loading pyodbc module: dlopen(/Users/jayyadav/Desktop/lms/lms_env/lib/python3.8/site-packages/pyodbc.cpython-38-darwin.so, 2): Symbol not found: _SQLAllocHandle Referenced from: /Users/jayyadav/Desktop/lms/lms_env/lib/python3.8/site-packages/pyodbc.cpython-38-darwin.so Expected in: flat namespace in /Users/jayyadav/Desktop/lms/lms_env/lib/python3.8/site-packages/pyodbc.cpython-38-darwin.so

Issue installing on MacOS

Tried to install in the Terminal but Home Brew doesn't seem to have a msodbcsql17 formulae to install. I received this message:

(base) Nicholass-MacBook-Pro:~ Nick$ Error: No available formula with the name "msodbcsql17"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.

odbcinst: SQLInstallDriverEx failed with Invalid install path.

When trying to install the PHP SQLSRV drivers on OS X Sierra, I get the error odbcinst: SQLInstallDriverEx failed with Invalid install path.

I'm following the steps here: https://github.com/Microsoft/msphpsql/tree/master#install-unix
All the steps work until I get to these:

brew tap microsoft/msodbcsql https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install msodbcsql

This is the output of homebrew:

==> Installing msodbcsql from microsoft/mssql-release
==> Using the sandbox
==> Downloading http://download.microsoft.com/download/4/9/5/495639C0-79E4-45A7-B65A-B264
Already downloaded: /Users/scott/Library/Caches/Homebrew/msodbcsql-13.1.9.0.tar.gz
The license terms for this product can be downloaded from
https://aka.ms/odbc131eula and found in
/usr/local/share/doc/msodbcsql/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)
YES
==> odbcinst -u -d -n "ODBC Driver 13 for SQL Server"
==> odbcinst -i -d -f ./odbcinst.ini
Last 15 lines from /Users/scott/Library/Logs/Homebrew/msodbcsql/02.odbcinst.ini:
2017-07-31 18:41:58 -0400

odbcinst -i -d -f ./odbcinst.ini

odbcinst: SQLInstallDriverEx failed with Invalid install path.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/microsoft/homebrew-mssql-release/issues

Are there any steps to take besides what is listed on the webpage I linked?

Install fails: msodbcsql17 depends on old version of openssl

Hi, following the instructions for installing the msodbcsql17 driver on a Debian 9 Docker image used to work (last tried in September 2018). However when I try the same build and try to query a SQL Server database I receive the following error; "Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found"
The file is there but when I look at its dependencies using "ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1" I see the following problems: "libcrypto.so.1.0.2 => not found
libssl.so.1.0.2 => not found"
These are OpenSSL v1.0.2.d libraries, but the version of OpenSSL that is currently available is 1.1.1b-2.
I have tried creating symbolic links from libssl.so.1.0.2 to libssl.so.1.1.1 but this didn't work. I have also tried installing an old version of OpenSSL (using images from snapshot.debian.org) but this caused other required packages to be removed. How can i install msodbcsql17?
Thanks,
Dave

Missing libmsodbcsql dependency?

When I try to connect I get this error:

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Can't open lib '/usr/local/lib/libmsodbcsql.13.dylib' : file not found.

However, it seems to be already installed:

$ brew install msodbcsql 
Warning: microsoft/mssql-release/msodbcsql 13.1.9.0 is already installed

And here it is:

$ ls /usr/local/lib/libmsodbcsql.13.dylib 
/usr/local/lib/libmsodbcsql.13.dylib

Update install instructions (--no-sandbox is an invalid option)

The install instructions at https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017#os-x-1011-el-capitan-and-macos-1012-sierra feature the command:

brew install --no-sandbox [email protected] [email protected]

which fails because --no-sandbox isn't an option that brew install takes.

Usage: brew install [options] formula
[...options and usage text...]
Error: invalid option: --no-sandbox

The install succeeds fine when brew install is called just as is so the solution is just to remove this option.

There was the general all-options-removed change to Homebrew which affected all formulae, so I presume removing options relating to sandboxing were caught up in that too. See also https://discourse.brew.sh/t/since-homebrew-2-0-0-install-params-always-give-invalid-option/4075

Install fails on mssql-tools - specified blob doesn't exist

As per documentation, added additional tap and successfully installed msodbcsql17, however, attempt to install mssql-tools causes the following error:

Alexs-MacBook-Pro% brew install --no-sandbox mssql-tools
==> Installing mssql-tools from microsoft/mssql-release
==> Downloading https://sqlchoice.blob.core.windows.net/sqlchoice/17.2.0.1/macOS/mssql-tools-17.2.0.1.tar.gz

curl: (22) The requested URL returned error: 404 The specified blob does not exist.
Error: Failed to download resource "mssql-tools"
Download failed: https://sqlchoice.blob.core.windows.net/sqlchoice/17.2.0.1/macOS/mssql-tools-17.2.0.1.tar.gz

Problem installing macOS

When installing on:

  System Version:	macOS 10.15.2 (19C57)
  Kernel Version:	Darwin 19.2.0

I did:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update

Then I get the following error:

(base) ...@MAC-2019-16-012 ~ % HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools
==> Installing msodbcsql17 from microsoft/mssql-release
==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48-88DC-724E9ABCEB9A/msodbcsql-17.5.2.1.tar.gz
Already downloaded: /Users/.../Library/Caches/Homebrew/downloads/b8402326ee28ebb9b25b5c98a4fcfe0ecad17cd385a8ccb3ef5bedb0e097c2e0--msodbcsql-17.5.2.1.tar.gz
==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
Last 15 lines from /Users/.../Library/Logs/Homebrew/msodbcsql17/01.odbcinst:
2020-06-13 23:48:59 -0400

odbcinst
-u
-d
-n
"ODBC Driver 17 for SQL Server"

odbcinst: SQLRemoveDriver failed with Unable to find component name.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/microsoft/homebrew-mssql-release/issues

The location of files is:

(base) ...@MAC-2019-16-012 ~ %  odbcinst -j                                                                  
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/.../.odbc.ini     <===== this file is NOT created ie. does not exist
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

This is the content of 'usr/local/etc/odbcinst.ini' so does that mean that 'odbcinst' is not seeing this file e.g. expects it in another location:

[ODBC Driver 17 for SQL Server]
Description=Microsoft ODBC Driver 17 for SQL Server
Driver=/usr/local/lib/libmsodbcsql.17.dylib
UsageCount=1

I have followed the guide here. I have also looked at and attempted to follow the guidance offered at issue #42.

Note that the error above and the comments in the latter issue mention the uninstall using 'odbcinst -u -d -n "ODBC Driver 17 for SQL Server" '. It is unclear what the end result of this command is supposed do. The command is for an uninstall but the comments suggest something has to added as well.

I'm pretty confused at this point. Note that I have wrestled with installation of these drivers before and posted my results on Stack. It looks like things have changed since then. Any clarification would be welcome particularly:

  • what does successful installation look like ie. what files should be located where when the process is completed?
  • what should the content of the various .ini files be?

Usage Note:

I recently had to change laptops. I received a fresh laptop with Catalina already installed and my user files transferred. On the old laptop per my Stack post I had driver files in 'Library/ODBC'. The first I learned something was off was the error message below:

~/git/moat-ds/db_connect.py in Connect(self)
     22 
     23         ## Connect
---> 24         conn = pyodbc.connect(url)
     25 
     26         ## This converter allows the reading of some data formats used by MS SQL server

Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")

Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Can't open lib 'ODBC Driver 13 for SQL Server' : file not found

Installation

brew tap microsoft/msodbcsql https://github.com/Microsoft/homebrew-mssql-release && brew update
# brew untap microsoft/mssql-preview # Optionally.
ACCEPT_EULA=y brew reinstall msodbcsql mssql-tools

Problem

$ sqlcmd -S localhost
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Can't open lib 'ODBC Driver 13 for SQL Server' : file not found.
$ odbcinst -j
unixODBC 2.3.4
DRIVERS............: /usr/local/Cellar/unixodbc/2.3.4/etc/odbcinst.ini

It seems odbcinst is looking for odbcinst.ini file in the unixodbc package folder which is basically empty. Correct location:

$ brew list msodbcsql | grep odbcinst.ini$
/usr/local/Cellar/msodbcsql/13.1.9.0/odbcinst.ini

Where the one which is loaded, it's empty:

$ wc -l /usr/local/Cellar/unixodbc/2.3.4/etc/odbcinst.ini
0 /usr/local/Cellar/unixodbc/2.3.4/etc/odbcinst.ini

Workaround

cp -v "$(brew list msodbcsql | grep odbcinst.ini$)" ~/.odbcinst.ini

Notes

  • Adding --without-registration or --no-sandbox added to brew install msodbcsql command doesn't take any effect.

Related

brew output download failed

Dear Microsoft,

This is message I got.

Byungkyus-Mac-Pro:~ bpark$ brew install --without-registration msodbcsql
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
kerl

==> Installing msodbcsql from microsoft/mssql-release
==> Downloading http://download.microsoft.com/download/4/9/5/495639C0-79E4-45A7-B65A-B264071C3D9A/msodbcsql-13.1.9.0.tar.gz

curl: (56) Recv failure: Operation timed out
Error: Failed to download resource "msodbcsql"
Download failed: http://download.microsoft.com/download/4/9/5/495639C0-79E4-45A7-B65A-B264071C3D9A/msodbcsql-13.1.9.0.tar.gz

This is my config of brew

Byungkyus-Mac-Pro:~ bpark$ brew config
HOMEBREW_VERSION: 1.3.6
ORIGIN: https://github.com/Homebrew/brew
HEAD: 270b752f5d9d218bfbed6fe85b6974fa653fb25f
Last commit: 3 weeks ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 8d2303f426d783a9ea98dfc567c29a8e50ff9c88
Core tap last commit: 2 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: 24-core 64-bit ivybridge
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /Users/bpark/anaconda2/bin/python => /Users/bpark/anaconda2/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_151
macOS: 10.12.6-x86_64
Xcode: 8.2
CLT: 9.0.1.0.1.1506734476
X11: 2.7.112 => /opt/X11

and curl version.

Byungkyus-Mac-Pro:~ bpark$ curl --version
curl 7.55.1 (x86_64-apple-darwin13.4.0) libcurl/7.55.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0
Release-Date: 2017-08-14
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy

Can you give me any suggestion?

Thank you.

Error trying to run homebrew-mssql formula in mac OS Big Sur (M1)

Hi,
I read that ODBC Driver for SQL Server was ready for mac with M1 and I'm trying to install it but I have not succeeded. I'm following this guide:
https://github.com/microsoft/msphpsql/blob/master/Linux-mac-install.md#installing-the-drivers-on-macos

When I run the code indicated in the documentation of the Driver:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release brew update HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 ms sql-tools

(https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos?view=sql-server-ver15)

I get the following error:

Captura de Pantalla 2022-01-14 a la(s) 12 13 33

Any help on this is highly appreciated.

Problems installing msodbcsql17 and mssql-tools

Im using Spyder (Ananconda) to connect to MS sql server using pyodbc. Im working on Apple M1 chip, 2021 make. Python didnt recognize the unixodbc driver initially and sent an error to install x86-64 version instead of arm64. i then uninstalled brew completely and installed x86-64 with rosetta. Python now recognizes the unixodbc driver and able to import pyodbc package. To connect to mssql server, i need to install mssql-tools and msodbcsql17, it doesnt throw any error while installing the ms drivers, installation just skips. attaching some needful information below.

msodbcsql17 and mssql-tools installation:
bash-3.2$ brew install mssql-tools msodbcsql17
==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48-88DC-724E9ABCEB9A/msodbcsql17-17.8.1.1-amd64.tar.gz
Already downloaded: /Users/v0s03aa/Library/Caches/Homebrew/downloads/4e244e94bb2cf243bfb6a52aa7e894e6302f742b4a39a46aeab827c75e3661ca--msodbcsql17-17.8.1.1-amd64.tar.gz
==> Downloading https://download.microsoft.com/download/F/D/1/FD16AA69-F27D-440E-A15A-6C521A1972E6/mssql-tools-17.8.1.1-amd64.tar.gz
Already downloaded: /Users/v0s03aa/Library/Caches/Homebrew/downloads/647f6e1067f9bae2f6d5568ce5d08630eea5d36135c117922d8a857fc852a623--mssql-tools-17.8.1.1-amd64.tar.gz
==> Installing mssql-tools from microsoft/mssql-release
==> Installing dependencies for microsoft/mssql-release/mssql-tools: msodbcsql17
==> Installing microsoft/mssql-release/mssql-tools dependency: msodbcsql17
The license terms for this product can be downloaded from
https://aka.ms/odbc17eula and found in
/usr/local/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)
YES
==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
Last 15 lines from /Users/v0s03aa/Library/Logs/Homebrew/msodbcsql17/01.odbcinst:
2021-12-28 16:54:05 +0000

odbcinst
-u
-d
-n
"ODBC Driver 17 for SQL Server"

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/microsoft/homebrew-mssql-release/issues

Python version
bash-3.2$ python --version
Python 3.9.7

odbc version
bash-3.2$ odbcinst -j
unixODBC 2.3.9
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/v0s03aa/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

Any help on this is highly appreciated.

brew upgrade microsoft/mssql-release/msodbcsql

macOS 10.13.3 Beta (17D25b)

brew upgrade microsoft/mssql-release/msodbcsql
==> Upgrading 1 outdated package, with result:
microsoft/mssql-release/msodbcsql 13.1.9.0
==> Upgrading microsoft/mssql-release/msodbcsql 
==> Downloading http://download.microsoft.com/download/4/9/5/495639C0-79E4-45A7-
Already downloaded: /Users/minoseah629/Library/Caches/Homebrew/msodbcsql-13.1.9.0.tar.gz
The license terms for this product can be downloaded from
https://aka.ms/odbc131eula and found in
/usr/local/share/doc/msodbcsql/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)
YES
==> odbcinst -u -d -n "ODBC Driver 13 for SQL Server"
Last 15 lines from /Users/xxxx/Library/Logs/Homebrew/msodbcsql/01.odbcinst:
2017-12-26 19:21:13 -0800

odbcinst -u -d -n "ODBC Driver 13 for SQL Server"

odbcinst: SQLRemoveDriver failed with General installer error.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/microsoft/homebrew-mssql-release/issues

Still having local issue in msodbcsql17

Greetings,

I still experiencing the issue mentioned #18.

I used the last driver version:

~ ❯❯❯ brew info msodbcsql17
microsoft/mssql-release/msodbcsql17: stable 17.2.0.1
ODBC Driver for Microsoft(R) SQL Server(R)
https://msdn.microsoft.com/en-us/library/mt654048(v=sql.1).aspx
/usr/local/Cellar/msodbcsql17/17.1.0.1 (9 files, 2.7MB)
  Built from source on 2018-06-28 at 17:36:17
/usr/local/Cellar/msodbcsql17/17.2.0.1 (9 files, 2.7MB) *
  Built from source on 2018-09-20 at 10:32:21
From: https://github.com/Microsoft/homebrew-mssql-release/blob/master/Formula/msodbcsql17.rb
==> Dependencies
Required: unixodbc ✔, openssl ✔
==> Options
--without-registration
        Don't register the driver in odbcinst.ini
==> Caveats
If you installed this formula with the registration option (default), you'll
need to manually remove [ODBC Driver 17 for SQL Server] section from
odbcinst.ini after the formula is uninstalled. This can be done by executing
the following command:
    odbcinst -u -d -n "ODBC Driver 17 for SQL Server"

I got the infamous error:

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: collate_byname<char>::collate_byname failed to construct for UTF-8

locale -a

en_NZ
nl_NL.UTF-8
pt_BR.UTF-8
fr_CH.ISO8859-15
eu_ES.ISO8859-15
en_US.US-ASCII
af_ZA
bg_BG
cs_CZ.UTF-8
fi_FI
zh_CN.UTF-8
eu_ES
sk_SK.ISO8859-2
nl_BE
fr_BE
sk_SK
en_US.UTF-8
en_NZ.ISO8859-1
de_CH
sk_SK.UTF-8
de_DE.UTF-8
am_ET.UTF-8
zh_HK
be_BY.UTF-8
uk_UA
pt_PT.ISO8859-1
en_AU.US-ASCII
kk_KZ.PT154
en_US
nl_BE.ISO8859-15
de_AT.ISO8859-1
hr_HR.ISO8859-2
fr_FR.ISO8859-1
af_ZA.UTF-8
am_ET
fi_FI.ISO8859-1
ro_RO.UTF-8
af_ZA.ISO8859-15
en_NZ.UTF-8
fi_FI.UTF-8
hr_HR.UTF-8
da_DK.UTF-8
ca_ES.ISO8859-1
en_AU.ISO8859-15
ro_RO.ISO8859-2
de_AT.UTF-8
pt_PT.ISO8859-15
sv_SE
fr_CA.ISO8859-1
fr_BE.ISO8859-1
en_US.ISO8859-15
it_CH.ISO8859-1
en_NZ.ISO8859-15
en_AU.UTF-8
de_AT.ISO8859-15
af_ZA.ISO8859-1
hu_HU.UTF-8
et_EE.UTF-8
he_IL.UTF-8
uk_UA.KOI8-U
be_BY
kk_KZ
hu_HU.ISO8859-2
it_CH
pt_BR
ko_KR
it_IT
fr_BE.UTF-8
ru_RU.ISO8859-5
zh_TW
zh_CN.GB2312
no_NO.ISO8859-15
de_DE.ISO8859-15
en_CA
fr_CH.UTF-8
sl_SI.UTF-8
uk_UA.ISO8859-5
pt_PT
hr_HR
cs_CZ
fr_CH
he_IL
zh_CN.GBK
zh_CN.GB18030
fr_CA
pl_PL.UTF-8
ja_JP.SJIS
sr_YU.ISO8859-5
be_BY.CP1251
sr_YU.ISO8859-2
sv_SE.UTF-8
sr_YU.UTF-8
de_CH.UTF-8
sl_SI
pt_PT.UTF-8
ro_RO
en_NZ.US-ASCII
ja_JP
zh_CN
fr_CH.ISO8859-1
ko_KR.eucKR
be_BY.ISO8859-5
nl_NL.ISO8859-15
en_GB.ISO8859-1
en_CA.US-ASCII
is_IS.ISO8859-1
ru_RU.CP866
nl_NL
fr_CA.ISO8859-15
sv_SE.ISO8859-15
hy_AM
en_CA.ISO8859-15
en_US.ISO8859-1
zh_TW.Big5
ca_ES.UTF-8
ru_RU.CP1251
en_GB.UTF-8
en_GB.US-ASCII
ru_RU.UTF-8
eu_ES.UTF-8
es_ES.ISO8859-1
hu_HU
el_GR.ISO8859-7
en_AU
it_CH.UTF-8
en_GB
sl_SI.ISO8859-2
ru_RU.KOI8-R
nl_BE.UTF-8
et_EE
fr_FR.ISO8859-15
cs_CZ.ISO8859-2
lt_LT.UTF-8
pl_PL.ISO8859-2
fr_BE.ISO8859-15
is_IS.UTF-8
tr_TR.ISO8859-9
da_DK.ISO8859-1
lt_LT.ISO8859-4
lt_LT.ISO8859-13
zh_TW.UTF-8
bg_BG.CP1251
el_GR.UTF-8
be_BY.CP1131
da_DK.ISO8859-15
is_IS.ISO8859-15
no_NO.ISO8859-1
nl_NL.ISO8859-1
nl_BE.ISO8859-1
sv_SE.ISO8859-1
pt_BR.ISO8859-1
zh_CN.eucCN
it_IT.UTF-8
en_CA.UTF-8
uk_UA.UTF-8
de_CH.ISO8859-15
de_DE.ISO8859-1
ca_ES
sr_YU
hy_AM.ARMSCII-8
ru_RU
zh_HK.UTF-8
eu_ES.ISO8859-1
is_IS
bg_BG.UTF-8
ja_JP.UTF-8
it_CH.ISO8859-15
fr_FR.UTF-8
ko_KR.UTF-8
et_EE.ISO8859-15
kk_KZ.UTF-8
ca_ES.ISO8859-15
en_IE.UTF-8
es_ES
de_CH.ISO8859-1
en_CA.ISO8859-1
es_ES.ISO8859-15
en_AU.ISO8859-1
el_GR
da_DK
no_NO
it_IT.ISO8859-1
en_IE
zh_HK.Big5HKSCS
hi_IN.ISCII-DEV
ja_JP.eucJP
it_IT.ISO8859-15
pl_PL
ko_KR.CP949
fr_CA.UTF-8
fi_FI.ISO8859-15
en_GB.ISO8859-15
fr_FR
hy_AM.UTF-8
no_NO.UTF-8
es_ES.UTF-8
de_AT
tr_TR.UTF-8
de_DE
lt_LT
tr_TR
C
POSIX

locale

~ ❯❯❯ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

odbcinst -j

~ ❯❯❯ odbcinst -j
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..: /Users/yoeight/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

I don't have that issue if I use the 13 version.

OSX: 10.14

Thanks for your time.

Brew not supported in the Enterprise

Many Enterprise organisations are unable to support brew and making an Enterprise toolset available only on brew limits it's availability for Enterprise users.

Please make these tools available for offline installation preferably in a .pkg format.

sqlcmd won't work with DSN, isql does

This one is leaving me baffled. I have a DSN configured for a server I call prod.

sqlcmd -D myproductionserverfullyspecified works just fine.

isql prod works just fine.

sqlcmd -D -S prod does not and throws the following:

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2AF9. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

Not sure where the disconnect is here, as isql seems to be picking up the DSN configuration just fine.

Any ideas? Bug? Feature? Misconfiguration?

Can't open lib'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")"

Hi -- i keep getting "Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")"

I followed instructions here:
https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/install-microsoft-odbc-driver-sql-server-macos?view=sql-server-ver15

And still get the error. I tried to install again and I receive SQLRemoveDrive failed with unable to find component name:

brew install microsoft/mssql-release/msodbcsql17
==> Installing msodbcsql17 from microsoft/mssql-release
==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48-88DC-724E9ABCEB9A/msodb
Already downloaded: /Users/jdmillay/Library/Caches/Homebrew/downloads/b69d65633d7f1a0c3f926c26b115c9d1ba8a432f2348a5d15cba5f981ef49cf3--msodbcsql-17.6.1.1.tar.gz
The license terms for this product can be downloaded from
https://aka.ms/odbc17eula and found in
/usr/local/share/doc/msodbcsql17/LICENSE.txt . By entering 'YES',
you indicate that you accept the license terms.

Do you accept the license terms? (Enter YES or NO)
Yes
==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
Last 15 lines from /Users/jdmillay/Library/Logs/Homebrew/msodbcsql17/01.odbcinst:
2020-10-05 20:23:30 -0400

odbcinst
-u
-d
-n
"ODBC Driver 17 for SQL Server"
odbcinst: SQLRemoveDriver failed with Unable to find component name.
$ odbcinst -j
unixODBC 2.3.7
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /Users/jdmillay/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8

Error requesting access token, HTTP status 404, expected 200

Hello,

I am not sure my problem is a "brew" problem. At the same time, a developer working on a Windows computer had no problem using exactly the same command line option.

My brew installed sqlcmd says:

$ sqlcmd  -S xxxxxxx.yyy.dynamics.com -d orgZZZZZZZ -G -U [email protected] -l 120 -P 'secret'
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Failed to authenticate the user '[email protected]' in Active Directory (Authentication option is 'ActiveDirectoryPassword').
Error code 0xA190; state 41360
.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Error requesting access token, HTTP status 404, expected 200.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x36.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Communication link failure.

Login and passwords have been verified twice.

Locally installed version:

microsoft/mssql-release/msodbcsql: stable 13.1.9.2
microsoft/mssql-release/mssql-tools: stable 17.6.1.1
/usr/local/Cellar/mssql-tools/17.6.1.1/bin/sqlcmd -\?
Microsoft (R) SQL Server Command Line Tool
Version 17.6.0001.1 Linux

Would you have any idea about this 404 problem when retrieving the token ?

Thank you for your appreciated help !

odbcinst: SQLRemoveDriver failed with Unable to find component name.

I am trying to install Microsoft ODBC driver 17 for SQL Server on macOS but I am getting the error.

I am not sure how to fix this issue. Could anyone help me with that? Thank you very much in advance!

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release brew update HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=Y brew install msodbcsql17 mssql-tools ==> Checking for sudo` access (which may request your password).
Password:
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /usr/sbin/chown -R administrator:admin /usr/local/Homebrew
==> Downloading and installing Homebrew...
HEAD is now at 5c44aca2e Merge pull request #12365 from Homebrew/dependabot/bundler/Library/Homebrew/rubocop-performance-1.12.0
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
https://docs.brew.sh/Analytics
No analytics data has been sent yet (or will be during this install run).

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
https://github.com/Homebrew/brew#donations

==> Next steps:

  • Run brew help to get started
  • Further documentation:
    https://docs.brew.sh
    Already up-to-date.
    Warning: HOMEBREW_NO_ENV_FILTERING is undocumented, deprecated and will be removed in a future Homebrew release (because it breaks many things)!
    ==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48
    Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/4e244e94bb2cf243bfb6a52aa7e894e6302f742b4a39a46aeab827c75e3661ca--msodbcsql17-17.8.1.1-amd64.tar.gz
    ==> Downloading https://download.microsoft.com/download/1/9/A/19AF548A-6DD3-4B48
    Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/4e244e94bb2cf243bfb6a52aa7e894e6302f742b4a39a46aeab827c75e3661ca--msodbcsql17-17.8.1.1-amd64.tar.gz
    ==> Downloading https://download.microsoft.com/download/F/D/1/FD16AA69-F27D-440E
    Already downloaded: /Users/administrator/Library/Caches/Homebrew/downloads/647f6e1067f9bae2f6d5568ce5d08630eea5d36135c117922d8a857fc852a623--mssql-tools-17.8.1.1-amd64.tar.gz
    ==> Installing msodbcsql17 from microsoft/mssql-release
    ==> odbcinst -u -d -n "ODBC Driver 17 for SQL Server"
    Last 15 lines from /Users/administrator/Library/Logs/Homebrew/msodbcsql17/01.odbcinst:
    2021-11-02 15:26:02 +0000

odbcinst
-u
-d
-n
"ODBC Driver 17 for SQL Server"

odbcinst: SQLRemoveDriver failed with Unable to find component name.

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/microsoft/homebrew-mssql-release/issues`

Create a Wiki that Points to or states the macOS installation solutions

It looks like there are a lot of problems with the macOS installation. The problems go as far back as version 13 of ODBC install. The solution for driver 'file not found' is that the files are placed in an unexpected directory. The solution is a symbolic link pointing the installer to where the files are actually located. The substance of that solution is outlined at this StackOverflow question/answer. I suggest:

  1. a wiki created here outlining the solution and/or
  2. the official MS installation page for macOS also make mention that as a final step the creation of symbolic links and finally
  3. the wiki and/or MS installation page should explicitly include a statement of what files (it does) were installed and WHERE they are installed. That way at least a user can tell if the installation executed properly.

Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib'

I am trying to get mssql working on my OSX machine. However, it keeps giving me error:

$ sqlcmd -S 0.0.0.0,1401 -U SA -P P@55w0rd -i database-setup/sql/initialize.sql     
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found. 

Although, I am pretty sure, my file is in that location:

$ ls -la /usr/local/lib/libmsodbcsql.17.dylib  
lrwxr-xr-x  1 localadmin  admin  64  7  4 16:38 /usr/local/lib/libmsodbcsql.17.dylib -> /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib 
$ ls -la /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib
-r--r--r--  1 localadmin  admin  2539360  7  4 15:34 /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib

I know this question has been asked multiple times but none of the available solutions have worked for me. Things I have tried:

Error: Failed to download resource "mssql-tools" 404 Not Found

For some reason, I cannot download mssql-tools. Getting 404. See output below.

MBP:~ ro$ brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
MBP:~ ro$ brew update
Already up-to-date.
MBP:~ ro$ brew install --no-sandbox mssql-tools
==> Installing mssql-tools from microsoft/mssql-release
==> Downloading https://download.microsoft.com/download/F/D/1/FD16AA69-F27D-440E

curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "mssql-tools"
Download failed: https://download.microsoft.com/download/F/D/1/FD16AA69-F27D-440E-A15A-6C521A1972E6/mssql-tools-17.1.0.1.tar.gz

Issue with installation on MacOS Mojave

Hello,
I'm trying to install and get the following errors:
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release

-e:1:in <main>': undefined method canonical_segments' for #<Gem::Version "2.3.7"> (NoMethodError)
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Already downloaded: /Users/miriam/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
perl version 5.26.1 can't run /usr/bin/shasum. Try the alternative(s):

/usr/bin/shasum5.18 (uses perl 5.18)

Run "man perl" for more information about multiple version support in
Mac OS X.
Error: Checksum mismatch.
Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104
Actual:
Archive: /Users/miriam/Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install vendor Ruby.

Could you please advise?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.