data-atom cson configuration for Windows authentication remote - sql-server

I can't connect to an mssql server using Windows Authentication on data-atom. I've successfully connected to servers using SQL server authentication, so I know data-atom is working. However, I can't figure out the proper parameters for windows authentication.
I normally log in using runas.exe /netonly /user:REALDOMAIN\YOURDOMAINUSERNAME Ssms.exe and then do windows authentication from there.
I've launched atom both using the netonly runas commands and normally. However, I am not able to find the proper parameters to connect to the server.
I've tried doing
{
name: WindowsAuth
protocol: "mssql"
user: = Username
password: ""
server: <ServerName>
database: "Master"
options: "domain=remoteDomain"
}
and
{
name: WindowsAuth
protocol: "mssql"
user: = remoteDomain\Username
password: ""
server: <ServerName>
database: "Master"
options: "domain=remoteDomain"
}

The first thing to know is that many data-atom connection questions can be resolved by looking at the documentation for tedious.js
In this specific case, even though you are using windows authentication, you need to give your username and password. Furthermore, the domain information is case sensitive, and needs to be stripped of anything like .local or .com.
Finally, you should not include any options related to trustedConnection. The domain option is sufficient.
My final configuration looks like
{
name: WindowsAuth
protocol: "mssql"
user: = remote_domain_username
password: password
server: server_name
database: root_db
options: "domain=remote_domain_match_case"
}
Though, it is best practice not to store your password in your config file. Instead, type it in whenever you open a new connection.

Related

Pimcore Database Installation on a Different Server

I have just started using Pimcore and deployed its a mysql database on another server. During its installation, it couldn't connect to the database. I created the database yml file using this link https://pimcore.com/docs/5.x/Development_Documentation/Getting_Started/Advanced_Installation_Topics.html for the configuration and still does not work. It only works when the database is on the same server as pimcore. The error it gave when I do a remote connection is this:An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'SSL_USER'#'x.x.x.x' (using password: YES).
The yml file I created looks like this:
parameters:
database_credentials:
user: SSL_USER
password: password
dbname: project_database
# env variables can be directly read with the %env() syntax
# see https://symfony.com/blog/new-in-symfony-3-2-runtime-environment-variables
host: x.x.x.x (Ip address of db server)
port: 3306
Please take a look, you are using 'SSL' reserved word in your username.
Just use another username.
Please see the list of reserved words here: https://dev.mysql.com/doc/refman/8.0/en/keywords.html

Plotly and SQL Server Express compatibility

I'd like to know if the Plotly Database Connector (when doing a SQL Server connection) supports a SQL Server Express edition database.
I tried to connect using the sa username and its password but nothing happened. I get the error:
Failed to connect to [hostname]:[PortNumber] - connect ECONNREFUSED [my IP address]:[PortNumber]
These are my inputs:
Username: sa
Password: mypassword
Host: myHost (SQL Server Express as my instance)
Port: (I left this port blank)
Database: myDB
So, it is compatible? Or does it only work with (full) SQL Server?
Well I achieved to connect SQL SERVER Express with the Plotly Database Connector, so I hope this answer helps someone in the future!
First of all I asked in its GitHub page and the developer answered with a reference of the same problem and its solution.
Basically you have to search and modify the file named: connection-manager.js
Which was located in this directory: C:\Users\Arturo\AppData\Local\Programs\plotly-database-connector\resources\app\node_modules\sequelize\lib\dialects\mssql\connection-manager.js after I installed the Connector in my PC (your path may vary).
Then, you open it, and, in the line 42 you'll see this code (if it isn't in that line just look up for the code) :
var connectionConfig = {
userName: config.username,
password: config.password,
server: config.host,
options: {
port: config.port,
database: config.database
}
The problem here is that you have to give it the instance name, so, we will add one line more of code:
var connectionConfig = {
userName: config.username,
password: config.password,
server: config.host,
options: {
port: config.port,
database: config.database,
instanceName: 'SQLEXPRESS'//this line.
}
And that's it! We save the file and restart our Plotly Database Connector, after doing it we introduce our credentials as usual (without the \sqlexpress in the host field) and it will work!
Note: If you have a text editor like SublimeText, it's easier to find the code that I'm showing, just press Ctrl+Shift+F and search by folder, inserting the full path of the Plotly Database Connector.

Connection string to connect to a local SQL Server database using windows authentication

I m operating on Windows Server 2008 and I want to connect my application to a local SQL Server database .
I have read this: https://codedark.xyz/blog/connecting-to-ms-sql-server-with-knex
I have enabled TCP/IP connections to the server as well as default port 1433 for SQL Server. I then restarted the server instance.
I'm trying to connect with Windows authentication and my connection string looks like this :
mssql: {
client : "mssql",
connection: {
server : "localhost",
user : "windowsusername",
password : "windowspassword",
options: {
port: 1433,
database : "mydb",
encrypt: true
}
},
}
I get this error :
Login failed for user 'windowsuser'
My question: is it possible to connect to a local SQL Server database using Windows authentication? And if yes, which are the right credentials?
If you wish to use windows authentication, which I would recommend, then remove the user and password information and try this:
Integrated Security: "SSPI"
Depending on your set up, using windows auth could prove difficult unless you can specify the connection string as an actual string and not an object.
See this question for additional information Stack Reference

How to set the proper connection parameters to connect a SQL Server database in Atom Editor using Data-Atom package?

I'm trying to use Data-Atom package in the Atom Editor to connect to a SQL Server 2012 database. I can connect to the database with SQL Server Managment Studio using Windows Authentication or SQL Server Authentication. How the data-atom-connections.cson file should be using these two authentication methods?
My data-atom-connections.cson file looks like this:
[
{
name: "WindowsAuthentication"
protocol: "sqlserver"
user: "username"
password: "password"
server: "apphost/Username"
database: "master"
options: ""
}
{
name: "SQLServerAuthentication"
protocol: "sqlserver"
user: "userlogin"
password: "password"
server: "apphost/sqlexpress"
database: "master"
options: ""
}
]
But I get this error:
Error(ESOCKET) - Failed to connect to apphost:1433 - connect ECONNREFUSED 192.168.56.1:1433
Note: for specifying the server name I saw this post Logging In to SQL Server
When this pull request is merged into data-atom you should have more luck.
Enter SERVER\INSTANCE in the server field, or SERVER\\INSTANCE if you're editing data-atom-connections.cson directly, to connect to a named instance.
Add the option domain=YOUR_DOMAIN to the options string to use Windows authentication (see more options for SQL Server here)
If you don't want to wait for the code to be merged into upstream and a new release, take it straight from my repo and place/link under ~/.atom/packages.
The protocol part of the URL has changed to mssql for SQL Server to align with node-mssql.

windows authentication on SQL server

I am trying to connect to a SQL server using Windows authentication. I am doing it through node js on Visual Studio.
The SQL server is on my machine itself.
It had worked fine for the connection string
var config = {
server: '10.2.9.208',
database: 'DFMProAnalyticsCopy',
user: 'sa',
password: 'admin123#',
port: 1433 //default port number
};
But this was only for SQL authentication.
Now for Windows aunthentication, I have this connection string
var config =
"Driver ={SQL Server};Server = 10.2.9.208;Database=DFMProAnalyticsCopy;Trusted_Connection=True;";
This gives me error
Unknown driver SQL Server!
and this connection string
var config =
"Server = 10.2.9.208;Database=DFMProAnalyticsCopy;Trusted_Connection=True;";
gives error
Login failed for user ''
It is trying to attempt SQL authentication when I want Windows authentication. I have Mixed mode authentication ON.
I read at many places but am still unclear about it.
"Login failed for user ''" when trying to use Windows Authentication
Please help me.
EDIT 1:
I cannot use the configuration string as in SQL Server connection with jQuery and node js
because mine is centralised and anyone could be using it, so I need to use Trusted_connection=true or Integrated security = SSPI. I dont have windows login credentials of people using the system.
This worked for me. I had to provide an UID and password in the connection string, else it considered a null string for UID
var config = "Server={IPV4 of server};Database=dbname;Uid=domain\\username;Pwd=pwd";

Resources