freetds

Laravel connect to a SQL Server 2008 named instance

回眸只為那壹抹淺笑 提交于 2021-02-17 22:55:35
问题 I am trying to connect an SQL server from an Ubuntu machine, everythings works great except for named instances: this works 'data' => array( 'driver' => 'sqlsrv', 'host' => 'xxxx', 'port' => 1433, 'database' => 'db', 'username' => 'user', 'password' => 'pwd', 'prefix' => '', ), this doesn't 'data' => array( 'driver' => 'sqlsrv', 'host' => 'yyyy\NAMEDINSTANCE', 'port' => 1433, 'database' => 'db', 'username' => 'user', 'password' => 'pwd', 'prefix' => '', ), I always end up with this error:

How to connect to SQL Server using FreeTDS ODBC

半腔热情 提交于 2021-02-10 15:57:11
问题 I am trying to connect to my company's SQL Server Databases via my MacBook and have followed the steps outlined here: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX but keep getting the following error when I get to the following step: Check that all is OK by running isql TEST myuser mypassword . You should see the following: +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------

How to connect to SQL Server using FreeTDS ODBC

元气小坏坏 提交于 2021-02-10 15:56:00
问题 I am trying to connect to my company's SQL Server Databases via my MacBook and have followed the steps outlined here: https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Mac-OSX but keep getting the following error when I get to the following step: Check that all is OK by running isql TEST myuser mypassword . You should see the following: +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------

「PHP」- 连接SQL Server数据库 @20210208

自作多情 提交于 2021-02-08 20:54:17
在PHP中,如果要连接SQL Server数据库,可以使用以下几种驱动: * **Mssql** * **PDO_SQLSRV (Windows only)** * **PDO_ODBC** * **SQLSRV** (Windows only) * Unified ODBC API 上述内容是复制于官网(03/11/2019)。 但是,实际情况会更复杂一些,尤其是PDO_SQLSRV与SQLSRV,它俩不光是Windows only的。 # SQLSRV - Microsoft SQL Server Driver for PHP SQLSRV: http://php.net/manual/en/book.sqlsrv.php PHP -> SQLSRV -> SQLSERVER 在Windows上运行PHP时 ,该扩展允许您访问Microsoft SQL Server和SQL Azure数据库。版本3.0的驱动程序支持SQL Server(从SQL Server 2005开始,包括SQL Server 2012,SQL Server 2012 LocalDB)。 有关LocalDB的更多信息,参考「 PHP Driver for SQL Server Support for LocalDB and » SQL Server 2012 Express LocalDB 」

FreeTDS Displays Unexpected EOF from the server

别说谁变了你拦得住时间么 提交于 2021-02-07 09:35:27
问题 I'm using FreeTDS 0.82 installed on OS X Snow Leopard to connect to a SQL Server 2005 database. When I try to connect with tsql, I get this: tsql -S abc -U uuu locale is "en_US.UTF-8" locale charset is "UTF-8" Password: Msg 20017, Level 9, State -1, Server OpenClient, Line -1 Unexpected EOF from the server Msg 20002, Level 9, State -1, Server OpenClient, Line -1 Adaptive Server connection failed There was a problem connecting to the serve freetds.conf: [abc] Host = host.host.domain port =

pymssql连接Azure SQL Database

笑着哭i 提交于 2020-11-21 04:08:25
使用pymssql访问Azure SQL Database时遇到 “ DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (xxxx:1433)\n') ” 这样的错误,具体错误如下所示: # python test.py Traceback (most recent call last): File "src/pymssql.pyx", line 636, in pymssql.connect File "src/_mssql.pyx", line 1957, in _mssql.connect File "src/_mssql.pyx", line 676, in _mssql.MSSQLConnection.__init__ File "src/_mssql.pyx", line 1683, in _mssql.maybe_raise_MSSQLDatabaseException _mssql.MSSQLDatabaseException: (20002, b'DB-Lib error message 20002, severity 9:\nAdaptive Server connection failed (xxxx.database.chinacloudapi.cn:1433

Python模块-pymssql

独自空忆成欢 提交于 2020-10-29 06:58:59
[TOC] Python默认的数据库是 SQLlite,不过它对MySql以及SQL server的支持也可以。如果想链接操作SQL server,需使用第三方包 pymssql pymssql 是一个Python的数据库接口,基于FreeTDS构建,对_mssql模块进行了封装,遵循Python的DBAPI规范,而FreeTDS是一个C语言连接sqlserver的公共开源库 工作原理 使用connect创建连接对象; connect.cursor创建游标对象,SQL语句的执行在游标上执行; cursor.execute()方法执行SQL语句,cursor.fetch()方法获取查询结果; 如果有反向修改,需执行connect.commit(); 调用close方法关闭游标cursor和数据库连接; 注意: https://www.cnblogs.com/baiyangcao/p/pymssql_basic.html 一个连接一次只能有一个游标的查询处于活跃状态! 可以通过使用 with 语句来省去显示的调用 close 方法关闭连接和游标 pymssql 2.0.0 以上的版本可以通过 cursor.callproc 方法来调用存储过程 常用封装 class MSSQL: # 类的构造函数,初始化数据库连接ip或者域名,以及用户名,密码,要连接的数据库名称 def __init_

Docker运行Django

↘锁芯ラ 提交于 2020-08-18 21:31:10
编写Dockerfile FROM python:3.6.4 RUN mkdir /code \ &&apt-get update \ &&apt-get -y install freetds-dev \ &&apt-get -y install unixodbc-dev COPY app /code COPY requirements.txt /code RUN pip install -r /code/requirements.txt -i https://pypi.douban.com/simple WORKDIR /code CMD ["/bin/bash","run.sh"] FROM:Dockerfile中的一个非常重要的命令,作用是指定一个基础镜像来进行构建流程。比如上面指定了python3.6.4作为基础镜像,后续的一切操作都会以这个镜像作为基础来进行定制,如果不存在,会从官网下载。FROM必须是Dockerfile首个命令。 RUN :Dockerfile执行命令最核心的部分,在构建镜像的过程中执行参数。 COPY:复制文件。COPY <源路径> <目标路径> WORKDIR:工作目录,若不存在,会自动帮你创建。 CMD:容器启动命令,Docker 不是虚拟机,容器就是进程。既然是进程,那么在启动容器的时候,需要指定所运行的程序及参数。 CMD

Can't connect to remote SQL Servers outside of network with PYODBC

China☆狼群 提交于 2020-08-02 07:23:17
问题 I for some reason can't seem to connect to any SQL Server that is outside of our network, yet have no problem if I'm within the network via VPN. My code is as such for local connection: sql = pyodbc.connect( 'DRIVER={FreeTDS};' 'SERVER=192.168.1.xx\ROA;' 'DATABASE=RentalDB;' 'UID=xxxxxxx;' 'PWD=xxxxxxx' ) and the following is what I'm trying for remote: sql = pyodbc.connect( 'DRIVER={FreeTDS};' 'SERVER=69.178.xx.xx/ROA;' 'DATABASE=RentalDB;' 'UID=xxxxxxxx;' 'PWD=xxxxxxxx' ) When trying to

一次php访问sql server 2008的API接口的采坑

邮差的信 提交于 2020-04-29 14:10:32
2018年6月21日17:17:09,注意:不是详细文档,新手可能会看不懂 windows下安装 项目是sql server 2008的k3,php连接数据库写的API,因为是买的时候是别人的程序,测试环境用的windows 2008,首先需要需要下载对应的php版本的DLL和驱动,好多人只下载的DLL,但是没有ODBC安装驱动, 还得根据版本下载,https://docs.microsoft.com/zh-cn/sql/connect/php/microsoft-php-driver-for-sql-server?view=sql-server-2017,这个总说明 https://docs.microsoft.com/zh-cn/sql/connect/php/step-1-configure-development-environment-for-php-development?view=sql-server-2017这个是详细说明 下载驱动关系就是 PHP 要了解如何下载并安装最新的稳定 PHP 二进制文件,请参阅 PHP 网站 。 Microsoft Drivers for PHP for SQL Server 需要以下版本的 PHP: SQL Server 驱动程序版本的 PHP→ ↓ PHP 版本 5.3 和 5.2 4.3 4.0 3.2 3.1 7.2 7.2.1