Damien | 26 Mar 2012 09:25

SQL Server Express 2008 R2 - Connection Error

Hi there,

After running into some issues compiling from source - bumping up against the --
mno-cygwin issue using the latest MinGW release! :( - I reverted back to using 
Python 32 bit 2.7.2 environment, with the precompiled IMDbPy binary.

Using Pip, here's what I have:

c:\Python27\Scripts>pip freeze
Cython==0.15.1
FormEncode==1.2.4
IMDbPY==4.8.2
MySQL-python==1.2.3
SQLAlchemy==0.7.6
SQLObject==1.2.2
distribute==0.6.24
lxml==2.3.3
pymssql==2.0.0b1

This is under Windows 7. Each of the above was installed from a binary package. 
Now with this setup, I can dump the entire IMDb to MySQL using:

python27 imdbpy2sql.py -d d:/install/imdb/subset/ -u 
"mysql://root:mysql <at> localhost/imdb" --mysql-force-myisam

Which works great. However, now I'd like to get the same info into SQL Server 
Express 2008 R2. I have created an imdb user/login for SQL Server.

Yet when I execute:

(Continue reading)

Davide Alberani | 31 Mar 2012 17:58
Picon
Gravatar

Re: SQL Server Express 2008 R2 - Connection Error

On Mon, Mar 26, 2012 at 09:25, Damien <damien.stewart@...> wrote:
>
> Traceback (most recent call last):
>  File "imdbpy2sql.py", line 519, in <module>
>    connectObject = conn.getConnection()
>  File "C:\Python27\lib\site-packages\sqlobject\dbconnection.py", line 336, in g
> etConnection
>    conn = self.makeConnection()
>  File "C:\Python27\lib\site-packages\sqlobject\mssql\mssqlconnection.py", line
> 94, in makeConnection
>    con = self.dbconnection( *self.make_conn_str(self) )
>  File "pymssql.pyx", line 552, in pymssql.connect (pymssql.c:7162)
> pymssql.InterfaceError: Connection to the database failed for an unknown reason.
>
> Any ideas?

First of all, pardon for the long delay. :-/

Hmmm... not much, not knowing enough of SQL Server.
Maybe you can just try interfacing with it using SQLAlchemy, instead of the
default SQLObject.  Try adding the "-o sqlalchemy" argument to the
imdbpy2sql.py command line...

HTH,

--

-- 
Davide Alberani <davide.alberani@...>  [PGP KeyID: 0x465BFD47]
http://www.mimante.net/

------------------------------------------------------------------------------
(Continue reading)

Damien | 3 Apr 2012 05:42

Re: SQL Server Express 2008 R2 - Connection Error

Davide Alberani <davide.alberani <at> ...> writes:

> 
> First of all, pardon for the long delay. :-/
> 
> Hmmm... not much, not knowing enough of SQL Server.
> Maybe you can just try interfacing with it using SQLAlchemy, instead of the
> default SQLObject.  Try adding the "-o sqlalchemy" argument to the
> imdbpy2sql.py command line...
> 
> HTH,
> 

Hi David, no worries about the delay - we're all busy :)

I should have stated in my original post  also tried SQL Alchemy. Here's the 
output:

---
c:\Python27\Scripts>python27 imdbpy2sql.py -d d:/install/imdb/subset/ -u "mssql+
pymssql://imdb:imdb <at> localhost/imdb" --ms-sqlserver -o sqlalchemy
2012-04-03 13:36:47,696 WARNING [imdbpy.parser.sql.alchemy] C:\Python27\lib\site
-packages\imdb\parser\sql\alchemyadapter.py:38: Unable to import migrate.changes
et: Foreign Keys will not be created.
Traceback (most recent call last):
  File "imdbpy2sql.py", line 501, in <module>
    conn = setConnection(URI, DB_TABLES)
  File "C:\Python27\lib\site-packages\imdb\parser\sql\alchemyadapter.py", line 4
86, in setConnection
    eng_conn = engine.connect()
(Continue reading)

Davide Alberani | 8 Apr 2012 12:58
Picon
Gravatar

Re: SQL Server Express 2008 R2 - Connection Error

On Tue, Apr 3, 2012 at 05:42, Damien <damien.stewart@...> wrote:
>
>  File "pymssql.pyx", line 549, in pymssql.connect (pymssql.c:7110)
> sqlalchemy.exc.OperationalError: (OperationalError) (20009, 'Net-Lib error durin
> g Unknown error') None None
   [...]
> I have created a blank DB in SQL Server which I can connect to okay using SQL
> Server Management Studio. I would expect the error messages to be a little more
> helpful, perhaps stating the login is incorrect or something - but the last few
> lines seem to indicate something is broken :(

Yep. :-(
Sorry, but I know next to nothing about databases on a Windows environment,
so I can't be of any help on this.

--

-- 
Davide Alberani <davide.alberani@...>  [PGP KeyID: 0x465BFD47]
http://www.mimante.net/

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2

Gmane