I am very new to both aws ec2 instances and postgresql. I was able to get a database up and working for a web application mainly using the phppgadmin interface. Today I was working on my web app and was abruptly disconnected from the database. In my web app I got the error " pg_connect(): Unable to connect to PostgreSQL server: could not connect to server: Connection refused\n Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?" I now can't log in to phppg admin or connect to postgres from my ec2 instance command line. After inspecting the log file at /var/log/postgresql/postgresql-12-main.log I am seeing the error "FATAL: could not open file "global/pg_filenode.map": Permission denied" followed by "LOG: abnormal database system shutdown" I have my pg_hba.conf and postgresql.conf files are configured correctly as I have been doing work on this database for a few days now. Any help would be appreciated.
You or something else wrecked your PostgreSQL installation by changing permissions on or ownership of PostgreSQL files. On Windows and its interesting concepts of file locking, I'd suspect an anti-virus program, but you seem to be running some kind of Unix. Little more can be said with the little information in the question.
Related
I want to ask you about a problem.
I have developed a windows application that uses a SQL Server database with SQL Server authentication (with a username and password) to log in.
The database is located on a local server which uses the same network as my company computers.
Now I have published the application and installed it on my computer (where I developed it and in which I also have the SQL server installed).
I also installed the application on the computers of some colleagues who do not have any program installed (they do not have Visual Studio or SQL Server installed).
When I try to log in to the application from my computer everything works fine.
(I can enter in application and database communication works very well).
But when I try to log in to the application from other computers (with the same user which I used on my computer before), it does not work.
I get this error:
Named pipes provider error 40 could not open a connection to SQL Server
I did these steps on the server where the application is located as:
Enable TCP / IP in SQL Server Configuration
Open Port in Windows Firewall 1433
Allow remote connections to this server
Can you help me with any suggestions?
I would try creating a ODBC connection to your machine from the client as a quick test - using the ODBC control panel. If that works, then check your connection string in the app. Maybe it's configured as a local connection? (The connection string would be my first guess.)
There are so many things that can be wrong that it a guessing game. This link might help.
https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/troubleshoot-connecting-to-the-sql-server-database-engine?view=sql-server-ver15
My Perl IIS web application is getting an SSL Error when the Perl DBI tries to connect to my MS SQL Server database version 11.0.7001 (that's what is listed in SQL Server Manager). The Perl application runs under IIS, and my IIS Basic User Settings Connection is set to Specific User (Domain Administrator).
The SQL Sever database resides on the same system as IIS. The distribution of Perl is Strawberry Perl; IIS' version is 8.5.9600.16384.
I can connect to the database using the SQL Server Manager locally on the server as well as remotely from my workstation. The connection type is SQL username and password. The IIS application listens on port 8085. The IIS permissions are not restricted, and there is no SQL server connection string as part of IIS.
The first page of the application loads, but this first page does not try to connect to the SQL Server database.
I have been looking at Stackoverflow posts -- like this one -- for a while, and have tried some of the suggestions like making a system DSN (which tests correctly), instead of a DSN string in Perl.
None of the suggestions have helped, and many but not all of the posts are dealing with security and certificates, not an application that is behind a firewall. In other words, I do not have security turned on.
To the best of my knowledge there is no security turned on for this application, and Named Pipes and TCP/IP were already turned on, as was suggested in one of the posts I read.
Here is the error:
[Microsoft][ODBC SQL Server Driver][DBMSLPCN]ConnectionOpen (SECCreateCredentials()). (SQL-01000) at ../../include/DbArgs.pm line 266.
DBI connect('driver={SQL Server};server=arlsql\arlsql;database=BuildingPermit;uid=user;pwd=pwd','',...) failed: [Microsoft][ODBC SQL Server Driver][DBMSLPCN]SSL Security error (SQL-08001) [state was 08001 now 01000]
Any suggestions on what to try next would be appreciated.
Edit 1/6/2020
I need to add that my C# client application using .Net ODBC objects successfully accesses the same database on which the web-based Perl DBI code fails. The username and password are the same for the client application as that used in the Perl CGI.
The IIS user for this application runs as the domain administrator, but when creating the DBI connection uses the same username and password. The database is set up for SQL username and password, and, as stated previously, there is no security set, at least that I can tell.
This does not answer the question but is instead a workaround. I consider the following a workaround, because I would still like to know why the DBI call failed with a specific user.
I switched my IIS Basic User Settings Connection from Specific User (Domain Administrator) to Application User (pass-through authentication).
After making this change and restarting IIS, the Perl DBI connection worked, but why?
I configured both my development computer and my staging computer to be able to access SQL Server over the local network about one year ago (and everything worked fine until today). Yesterday evening, the head of our support team made some major changes in our physical switches and router equipments.
This morning, I had no internet access anymore on both my computer. What a mess!
We were able to to solve that problem by changing the default gateway (I have static IP configured) on both my computer.
Now I can access my development database server from my staging computer using either: "192.168.1.58\SQLEXPRESS" and "JONATHAN\SQLEXPRESS", but I cannot access my staging development database server from my development computer using: "192.168.1.56\SQLEXPRESS" or "STAGING\SQLEXPRESS".
Still, I can access my staging database server on the computer itself using both ip and named pipe.
That problem kind of bugging me up since both my SQL Server are using the same configurations (note: my development computer works fine without "Named Pipes". Activating it on my staging computer didn't solve the problem.)
Yet, every time I try to connect, I get the following error message:
A network-related or instance-specific error occurred while
establishing a connection to SQL Server. The server was not found or
was not accessible. Verify that the instance name is correct and that
SQL Server is configured to allow remote connections. (provider: SQL
Network Interfaces, error: 26 - Error Locating Server/Instance
Specified) (.Net SqlClient Data Provider)
Both my SQL Server (SQLEXPRESS) (I log on as "Network Service" as suggested in some threads) and SQL Server Browser services are running (tried to restart them several time) and turned off my firewall.
I can ping my staging computer:
Access the shared file via the network (\\STAGING):
And even access it's phpmyadmin via my browser (http://staging/phpmyadmin/).
I have the feeling I'm missing something obvious, but I can't seem to figure out what. I guess I need some more coffee ha, ha, ha.
Thank you all for your help
I'll write the answer since nobody suggest that on the internet.
When I regain internet/network access on my computer, I selected "work network" on my development computer and "public network" on my staging computer.
After playing some with the physical devices, the tech. who made the change suggested me to check out on which network I was (which was the same network "Network 4" except for being public vs work).
According to http://www.dummies.com/how-to/content/how-to-change-a-network-type-in-windows-7.html :
Windows 7 puts up your PC’s shields. Windows Firewall plugs almost all
its openings and protects its internal programs for being connected to
potentially hostile network.
But it seems to be a little bit more complicated than this since I had completely turned off my firewall on my staging computer. Beware of these additional public protections when configuring your SQL Server.
I tried to setup Remote Desktop Service Deployment in high availability mode over Windows Server 2012 following this link.
Everything works fine. The only issue is with Set-RDConnectionBrokerHighAvailability command. In this command database connection string is working with the IP of database but not with the FQDN of database server. It showed me error that database server is not reachable when I used FQDN. I need that to be work with FQDN.
I am not able to solve my problem but i am able to find a way around. i found another cmdlets Set-RDDatabaseConnectionString. Set-RDDatabaseConnectionString cmdlet configures database connection settings for the SQL Server database used in high availability environments with multiple Remote Desktop Connection Broker (RD Connection Broker) servers. I used it with FQDN and it works fine.
Thanks
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