Not able to install msnodesqlv8 on linux. I get this error when I'm trying to test my connection on Linux Server. Getting the below error.
Unsupported platform for msnodesqlv8#0.4.5: Wanted {"os":"win32", "arch":"any"} (Current:{"OS":"linux","arch":"x64"
Could you please give a work around for this.
I'm using that way
const sql = require("mssql/msnodesqlv8");
Related
I'm new to VS Code, new to SQL, programming in general. But, I am trying to install mssql in VS Code. It's not working - its says Azure Pipelines failed. In the terminal it says;
The library hostfxr.dll was found, but loading it from c:\Users\rimini201.vscode\extensions\ms-mssql.mssql-1.9.0\sqltoolsservice\1.9.0\Windows\hostfxr.dll failed
Any ideas please?
I want to connect mssql in my site and it's on CENTOS 6 and I am using PHP 5.5.
Got many solutions online about installing drivers regarding the PDO and ODBC, always getting error of no package found or failed dependencies, don't know why I am not able to install or proceed further.
Any help will be appreciated.
Thanks
If You want to use mssql_connect, You need to install php-mssql from extras repository:
yum install --enablerepo=extras php-mssql
and restart httpd:
service httpd restart
That's it :-)
I have a python code(python 3.5.1) in which I need to connect to SQL server. I am using the module 'pyodc' but its throwing me an error
"ImportError: No module named 'pyodbc'"
I am using eclipse on Windows 8.
Then I downloaded pyodc package from "https://github.com/mkleehammer/pyodbc". I tried to install using pip first but its not working on Windows 8.1:
"building 'pyodbc' extension error: Unable to find vcvarsall.bat'.
Then I tried running setup.py file in the folder. But still i am not able to import pyodc module.
Can anyone help me in properly importing the module. I am very new to python and I know there might be some beginner mistake.
I'm trying to connect to a database on Azure using node-mssql. My development system is Windows 7 and I have had no success at all getting node-sqlserver to install via WebMatrix.
My question is two part: Firstly is there any reason that even when I follow the instructions from Microsoft that I get errors with node-sqlserver? Trying the naive approach using NPM inside WebMatrix I get the following error:
An error occurred.
"C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "node-sqlserver" "--json"
Exit status 1
Failed at the node-sqlserver#0.1.0 install script.
This is most likely a problem with the node-sqlserver package,
not with npm itself.
Tell the author that this fails on your system:
node-gyp rebuild
You can get their info via:
npm owner ls node-sqlserver
There is likely additional logging output above.
Failed: npm reported an error.
NodeNpm.NpmException: Failed: npm reported an error.
at NodeNpm.NpmApi.Install(INpmPackage package)
at Microsoft.WebMatrix.NpmGallery.CachingPackageManger.InstallPackage(INpmPackage package)
at Microsoft.WebMatrix.NpmGallery.PackageViewModel.Install()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
The machine has VS2012 Professional installed.
The second part of my question is, is there any reason why using node-mssql won't work under Azure? I simply get a failed connection error, even though I've verified the details several times (substituted placeholders for actual values below):
var config = {
user: '{username}',
password: '{password}',
server: 'tcp:{server}.database.windows.net',
database: '{database}'
}
I get the following error:
{"name":"ConnectionError","message":"connection to tcp:{server}.database.windows.net:1433 >- failed Error: getaddrinfo ENOTFOUND"}
I realise that node-sqlserver is the best way to do it under Azure but I've tried for a couple of days with no success. Is there anything obvious I am missing?
1) You can solve it by downloading precompiled node-sqlserver driver from this repo. I was not able to compile sources on my machine even with all dev dependencies installed as well.
2) node-mssql module use three different drivers to communicate with sql server. Your config doesn't specify any driver, so the default one is used - Tedious. You must change your config to make it work correctly:
var config = {
user: '{username}',
password: '{password}',
server: '{server}.database.windows.net', // simply remove "tcp:"
database: '{database}'
}
There is also an option to use node-mssql with node-sqlserver but to make it work, you have to install compiled node-sqlserver driver manually. Config should look like this:
var config = {
driver: 'msnodesql',
user: '{username}',
password: '{password}',
server: 'tcp:{server}.database.windows.net',
database: '{database}'
}
I was using SQL Azure from Node.js last year when the module was named node-sqlserver so my answer might not work.
Ref your first problem, node-mssql should need to be compiled through node-gyp and C++ during NPM installation. So you'd better check if you have C++ compiler installed. When I was installing it told me I need VS2010 C++. Not sure if you need it now, or any later version. You can run npm install node-mssql from command window and you should get a log file if it failed, should be npm-error.log or something similar.
Ref your second problem, when I was using this module I use connection string. Could you double check your username was specified in format user#server. Also double check if your SQL Azure firewall was opened for other cloud services.
I'm running npm to install msnodesql, an npm library for sql server drivers. I am installing this on a Windows Server 2012 box.
I have installed Visual C++ 2010, node-gyp and Python 2.7.x.x as dependencies, and all of these installs were successful.
When I run npm install msnodesql, I get a big red error:
(x86)\MSBuild\Microsoft.Cpp\v4.0\Miscrosoft.Cpp.InvalidPlatform.Targets(23,7):
error MSB8007: The Platform for project 'sqlserver.vcxproj' is
invalid. Platform='x64'. You may be seeing this message because you
are trying to build a project without a solution file, and have
specified a non-default Platform that doesn't exist for this project.
My box is 64-bit. Not too experienced in this stuff at all, so though it looks like a platform error, i'm really not sure what to do.
Help!
I got the same error. Turns out I needed to remove my installed node.js (64 bit) and download 32-bit node.js instead. Once I did this I ran node-gyp configure, then node-gyp build with no errors.