I tried to search somewhere, but haven't found any answers.
Here is my problem :
I'm developing a website, using Symfony 3 and Propel 2. i've got some bundle connected to my own database, it works perfectly.
I've one bundle which should be connected to an other db (on a Microsoft SQL Server). The problem is, i can't connect to the db.
Here is my config.yml
propel:
database:
connections:
myconnection:
adapter: "pdo_mssql"
classname: Propel\Runtime\Adapter\MSSQL\MssqlDebugPDO
dsn: "host=MyHOST;dbname=DBname"
user: "user"
password: "password"
attributes:
All of my options are correct, i was able to connect to this db with DBeaver (a database manager).
When i try
bin/console propel:database:reverse myconnection
i've got this error
[Propel\Generator\Exception\InvalidArgumentException]
Invalid database name: no configured connection named
`host=MyHOST;dbname=DBname;user=user;password=password`.
So, could someone please help me ?
If you need more informations, just ask for it, and sorry for my english
ag.
Related
i have an ready database and I wanna use it in django web project. but I have an error about connection.
here is the error
raise NotSupportedError('SQL Server v%d is not supported.' % ver) django.db.utils.NotSupportedError: SQL Server v16 is not supported.
here is the packeges
asgiref 3.5.2
Django 2.1.15
django-mssql-backend 2.8.1
django-pyodbc-azure 2.1.0.0
django-pyodbc-azure-2019 2.1.0.0
mssql-django 1.2
pip 22.0.4
pyodbc 4.0.35
pytz 2022.7
setuptools 58.1.0
sqlparse 0.4.3
tzdata 2022.6
and database settings
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME':'veritabanıProje2',
'USER': 'sa',
'PASSWORD':'**',
'HOST':'DESKTOP-MDLFE99',
'PORT':'',
'OPTIONS':{
'driver':'ODBC Driver 17 for SQL Server',
},
},
}
I'm using SQL server 2022.
also the db file's name DB.sql in project directory. but I write here the name that is written while I create database. (I tried with DB.sql also of course)
I can understand the fault is about version but which one is wrong I dont know.
It may be due to several reasons such as-
Incorrect database connection settings: Make sure that you have entered the correct database name, server name, and login credentials in your Django settings.
Network issues: If your Django application is unable to connect to the database server, it could be due to network issues such as a firewall blocking access or a network configuration problem.
Incorrect version of Django or Python: Make sure that you are using a version of Django and Python that is compatible with the version of the Microsoft SQL Server database you are trying to connect to
I will update if i can get more source
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
At work I have been creating a full stack website using express and react with a sql server database.
I have now been self isolated due to the corona virus (everything at work was working fine).
I have restored the database and the code.
I have enabled tc/ip and pipelines in sql server configuration manager.
I have the made sure the password for the sa account is correct.
this is what i receive
] Err: ConnectionError: Connection is closed.
What else is there to check to make sure this is working?
Any help in what I may have overlooked would be great
edit ----
using npm mssql here is config
var config = {
user: "sa",
password: "Mypassword123",
server: "localhost", // You can use 'localhost\\instance' to connect to named instance
database: "CDA"
//enableArithAbort: false
};
I solved this by creating a default instance of sql and using this instead of the named instance I was trying to use.
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.
While making a database connection in pentaho report designer using JDBC, I am getting the following error :
Error connecting to database [database_name] : org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
Error connecting to database: (using class net.sourceforge.jtds.jdbc.Driver)
Network error IOException: Permission denied: connect
org.pentaho.di.core.exception.KettleDatabaseException:
Error occured while trying to connect to the database
I can't comment unfortunately, and without more information my answer will be a shot in the dark, therefore I will attempt to describe the perfect connection that you can use to connect to SQL Server 2008 via JTDS.
Put the jar that came with the JTDS package here: pentaho\report-designer\lib\jdbc.
If you wish to take advantage of the Windows Authentication, also grab the ntmlauth.dll file and put it in either System32 (for 64 bit Windows) or SysWOW64 (for 32 bit Windows, that's up to your configuration*). Fire up report designer.
New database connection:
Give it a connection name.
Set connection type to MS SQL Server, Native JDBC connection. The "MS
SQL Server(Native)" connection did not work for me.
Host name: the server's name where the Database sits. Server1, for
example.
Database Name: Take a wild guess what this might be. Yup, here you
enter your database name. Northwind, for example.
Instance name: Instance name, if you have any. Not mandatory.
Port number: default SQL server port is 1433.
User name / password: define one that has access to the database.
Leave it blank if you listened to me earlier and put the .dll file in
the right directory to use Windows Authentication.
Rejoice.
IN CASE you ever need the connection string and driver for SQL server connection:
driver: net.sourceforge.jtds.jdbc.Driver
URL (or string): jdbc:jtds:sqlserver://HostName:1433/databaseName
*let's not get caught up on the obviously challenged naming convention. I know, I know.