Lucee 5.3.3.62 - Error - Cannot open database "penumbra" requested by the login. The login failed. ClientConnectionId - sql-server

Bit of background, I need to remake this ColdFusion app in C# so I set up the legacy project on my machine and it was working fine till today, when I messed up running SQL commands (I know I should have used transactions, hindsight is fantastic). So I had a backup I made yesterday so I just deleted the DB I had in my SQLExpress and restored the backup and then I encoutnered the error below.
I don't remember making any changes or setting up anything in the permissions for the database so I don't think it something related to that.
I am getting the below error message when trying to login to the CF app that is running on Lucee, on my local machine.
Message Cannot open database "appName" requested by the login. The login failed. ClientConnectionId:555eb338-984e-4edf-a12b-c0662a0f6068
Stacktrace The Error Occurred in
C:\lucee\tomcat\webapps\appName\admin_cfcs\login.cfc: line 69
called from C:\lucee\tomcat\webapps\appName\admin\authenticate.cfm: line 26
called from C:\lucee\tomcat\webapps\appName\admin\dashboard\dashboard.cfm: line 2

Got the answer thanks to #Larnu 's suggestion in a comment to the questions.
Found the error in the Logs as suggested I had setup a user, for the database and it wasn't assigned to the database when I restored the new copy, so I just had to add the database "appName" to the User Mapping. Thanks :)

Related

Azure SQL Server Connection Error Despite Correct Credentials - Error Number:18456,State:1,Class:14

I have created a new SQL Database on Azure, and have copied the connection string directly from the Azure Portal.
On my .NET application, when I am trying to run 'Update-Database' command in Package Manager Console to commit the migration, I receive the following error:
Error Number:18456,State:1,Class:14 Login failed for user
'benhayward'.
Extra Information:
- I have changed my database admin password.
- I have confirmed that the log-in credentials are correct.
- I am on the Azure free trial.
Any advice or assistance on this would be greatly appreciated.
Ok a slightly embarrassing solution, but the reason this wasn't working is because of the curly brackets surrounding the password, as LeonYue suggested.
I had the same issue. The problem was that I had two entirelly different connection strings with the same name in different config files. The right one in app settings was being overwritten by another connection string in my user secrets. As soon as I deleted connection string from my secrets, everything went fine without any errors. Hope my solution will help the others

Wordpress website db connection error

I came over this serious problem.
My WordPress website was running all right. suddenly It showed the page of WordPress installation. so, I quickly registered a user and so on. Then it showed "db connection error". I went to my server and tried to log into my phpmyadmin but the password didn't work. This kept happening for 5 mins. then thing worked normal again.
1- is this a hacker attack?
2- how do I prevent the page of WP installation from showing up if the db connection goes down again? because this is a desaster
how do I prevent wp-admin from showing the name of my db in the db connection error ? Better preventing any error report from my website when anything is down?
thanks
Nobody can tell you whether it was hacker related without a lot more information. There should be logs on the machine hosting your site--I would check them first to see if you can tell if the database went down and why. If you don't admin your own site you can ask your hosting provider what the problem was--they may have been rebooting a database machine, for example.
I would also do a full backup of your site and database in case there is any hardware trouble you don't know about.
In the meantime, if you administer the site yourself, take a look at advice for hardening Wordpress: http://codex.wordpress.org/Hardening_WordPress

Login failed for user 'sa' while trying to create datasource with Railo

So I'm trying to setup Railo and I want to add a datasource.
For the database I'm using Microsoft SQL server Management Studio.
But now I've run into the classical problem: "Login failed for user 'sa'. ClientConnectionId:afd80ac2-0744-4a7d-a9f7-083d93adee0d"
What I've done so far:
With the SQL Server Configuration Manager in the TCP/IP settings I enabled the IPs I had to.
I set the password for the user 'sa' in MSSQL and I added a user mapping for the table I want to use.
I made the user 'sa' the owner of the DB i want to connect to
Restarted the SQL service, my computer and Railo multiple times.
I'm pretty much out of ideas.
After Leigh mentioned in the comments to look at my logs it had the following message: "Login failed for user 'max'. Reason: Failed to open the explicitly specified database 'test'. [CLIENT: 127.0.0.1]"
I then tried to make a connection without mentioning a database and that worked.
I would also point to Leigh's answer here which explains how to turn Mixed-Mode authentication on, as this can also cause this error. Since the cause of this isn't on Railo/Lucee's end, this issue still arises in 2018.
I just don't want a useful answer to get lost to history, nor plagiarize an answer I barely found.

Server crashed from traffic spike, now getting database connection error

So I posted a new blog on my site and promoted it on my facebook where the traffic spike was far bigger than anticipated, the server went down from the volume of traffic and after it was rebooted I am now getting a database connection error.
I contacted my server host and they told me this:
"I was able to get the relevant database details from the wp-config.php file in the home directory for your site and, using those creds I am able to connect to the relevant database without a problem.
To be sure that I was able to connect AND make a query to the database I have also created a simple test script that can be viewed at http://yoursite.com/mysqltest.php
This confirms that the server is responding correctly and that the database itself is able to accept connections and queries.
This leaves us with the likelihood that the issue lies with the scripting/configuration of the wordpress installation which is not something I am going to be able to assist you with.
I suspect that the problem lies with the wp-config.php file but cannot be certain."
I can't see how the wp-config would have changed, I haven't touched it in over a month and it's been working fine otherwise. The website was also working fine after I posted that blog, it was only after the server was rebooted that it doesn't. All the other sites on the server remain in perfect working condition. I don't see how a traffic spike could have done this. I'm lost as to what to do next? Please help! :(
D
Try this database connection test script https://gist.github.com/162913

SQL 2005 Database diagram support objects cannot be installed because this database does not have a valid owner

I have two databases, production and stage. I am getting the error message in the title of this post when I click "Database Diagrams" for production, but on stage I don't get an error.
I've researched this message, and I've found posts such as this:
Link
They pretty much say to change the owner of my database to sa. I'm not convinced this is the issue, though, because both production and stage databases have the same owner (not sa), but I only get this error for production.
Does anyone else know how else to resolve this error message?
both production and stage databases
have the same owner (not sa), but I
only get this error for production.
That usually is the very source of the problem: a database created on one machine is restored on a different machine where the SID of the original creator is no longer valid. Change the owner to a valid one:
ALTER AUTHORIZATION ON DATABASE::[<dbname>] TO sa;
I received this error. In my case, I had existing Diagrams but could not view them on account of this error. I remembered that I had changed the name of the server a week or so ago. After renaming the computer, SQL Server (2012) apparently correctly began using the correct underlying local user object in the Logins section of Security. So, from appearances, the database had a valid owner. But the name of the security account wasn't changed - the username of the owner was correctly localputer\localuser but the SQL account name was local-puter\localuser (the original name of the server). I renamed the account name to localputer\localuser and everything went back to normal. I did not need to issue an ALTER AUTH ON DB.

Resources