Iam running a codeigniter application which is hosted in IIS 7.Now I need it to use MSSQL server as DBMS.But I found some difficulties with connecting to MSSQL.can anybody please provide me with a good guide about this process.
thank you..
In the database configuration file, specify the database driver.
The config file is located at application/config/database.php
$db['default']['dbdriver'] = "mssql";
Reference : https://ellislab.com/codeigniter/user-guide/database/configuration.html
Related
So I'm currently following this tutorial from DigitalOcean:
https://www.digitalocean.com/community/tutorials/how-to-build-a-graphql-api-with-prisma-and-deploy-to-digitalocean-s-app-platform
I created a postgres database hosted on digitalocean.
When I try to connect to it with the following command:
DATABASE_URL="postgresql://db:some_password#unique_identifier.db.ondigitalocean.com:25060/db?sslmode=require" npx prisma migrate deploy --preview-feature
and replace the DATABASE_URL with my personal Connection String it gives me the following error:
"Error: P1001: Can't reach database server at
app-0336e984censored29-do-user-10651-0.b.db.ondigitalocean.com:25060"
Please make sure your database server is running at
app-0336e984censored29-do-user-10651-0.b.db.ondigitalocean.com:`25060
What is going wrong? My Database is live and the link is also correct
i think that the problem is that until the app is built, there is no static IP and therefore no access to the database, see this article:
https://www.digitalocean.com/community/questions/why-managed-database-can-t-have-app-platform-as-trusted-source
i solve it by moving the migration command to the 'run' section, see image
I am building a flask project for internal use at my company. I start by using flask and postgre and used sqlalchemy and set up that connection using the model formats like below:
app = Flask(__name__)
app.config.from_object('config')
db = SQLAlchemy(app)
and that worked well. Now for security reasons we are switching to using Microsoft SQL Server with window authentication on an IIS server but i am having a lot of trouble connecting.
I changed the database URI to
SQLALCHEMY_DATABASE_URI = "mssql+pyodbc://server/database"
I've checked the SQL Sever configuration and I am pretty sure that is correct. However I get the error
psycopg2.OperationalError: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
I have researched this issue and have used the pool_pre_ping solution but I get the same error (shown below)
SQLALCHEMY_ENGINE_OPTIONS = {"pool_pre_ping": True}
I have seen a lot of answers around this stuff that use the sqlalchemy.engine stuff but if possible I was hoping to use all of the db.models I have already written out but if that's not possible I can rewrite some stuff. Any help appreciated.
Windows Authentication will become a problem when you deploy to production. I recommend creating a SQL user to connect to your database.
Try this connection string:
mssql+pyodbc://<UID>:<PWD>#<SERVER>/<DATABASE>?driver=ODBC+Driver+17+for+SQL+Server;Trusted_Connection=no
Also make sure you've installed pyodbc msft docs
pip install pyodbc
Trying to connect to localdb using Database tab in Rider.
I adding SqlServer jTds and Rider shows this error
Connection to SunEngineDb1 failed. [08S01] Network error IOException:
.\pipe\MSSQL$LOCALDB#E65C6709\sql\query (Can not find the specified
file)
What am I missing, and how it can be solved?
It is ASP.NET Core 2.0 project with localdb database on development. If I run it it works perfectly including database connect.
Well, finally we discovered the problem. It is the mistake in the driver we provide. To have this issue fixed urgently, delete the file \config\jdbc-drivers\jdbc-drivers.xml and restart the IDE. Then, please, refresh your driver to 1.3.1.1 or just put [latest] there.
Can anyone help me in configuring SQL Server named instance in IBM Websphere Application server?
With Regards
Gopinathan K. Munappy
Try:
Server Name: "IPAddressServer\instanceName"
in the Common and required data source properties of Data Source Configuration, it works for me on WAS 8.0.0.3.
Please see page 24 of Accessing Databases chapter of WAS 7 Administration and Configuration Guide for Example: Connecting to an SQL Server database, which gives you step by step instructions.
You will have different options according to which JDBC driver you will use and kind of datasource you'll define (XA / nonXA). These options and respective configuration parameters are outlined in
Data source minimum required settings for Microsoft SQL Server document at infocenter.
I was trying to install a CMS throught the MS Web Platform Installer. During the installation process, it gives me an error saying "Could not open a connection to the database. This could be network or instance specific error."
Here's the screenshot: http://i.stack.imgur.com/gUroV.jpg of the error.
In Configuration Manager, Named Pipes, TCP/IP and Shared memory are enabled. I entered the server name as .\sqlexpress.
Take a look in your Services to make sure that the SQL Express service instance is running.
Well CakePhp is a PHP framework , and by default uses MySql .
Please make sure that mysql is intsalled and running as a service.
Also make sure no other process is listening on port # 3306 as that is by default the port of mysql