I am working on an app which is using Cloud SQL database. I am already connected with Cloud SQL instance using instance name, user name, password. I am able to create tables (by adding model), drop tables (by check) from App Maker level.
However I can't insert record using form. I also can't present the data in tables.
I am getting following error,
Exception: Unable to connect to database. Check the connection string,
user name, and password. Executing query for datasource ModelSQL:
(Error) : Unable to connect to database. Check the connection string,
user name, and password. Executing query for datasource ModelSQL
failed.
Did you set the preview credentials? (App Settings > GOOGLE CLOUD SQL > SQL preview credentials > UPDATE).
Please re-type CloudSQL credentials: in application setting - Cloud SQL for Preview or in deployment settings for Deployments.
Also ensure that your user is Editor or Owner on Google Cloud Platform's project with CloudSQL instance. And re-check setup instructions: https://developers.google.com/appmaker/models/cloudsql
Is the app running as user or as developer (https://developers.google.com/appmaker/security/identity)?
Related
I have previously deployed an MVC application to Azure.
Under Publish -> Settings -> Databases, I include connection strings.
I have been using the following: Data Source=tcp:servername.database.windows.net,1433;Initial Catalog=dbname;User ID=username;Password=password;Encrypt=True;TrustServerCertificate=False
The problem with specifying a user is that stored procedures run as the user specified.
This results in CreatedBy/ModifiedBy values set to this same user, instead of the user that created/modified the record.
I previously tried the following: Data Source=tcp:servername.database.windows.net,1433;Initial Catalog=dbname;Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated"
However, I receive the error "The format of the specified domain name is invalid." after the application is deployed. Even though I test the connection with Active Directory Integrated in the Destination Connection String window, and it works.
As given in this MS Doc, if you’re using the AD Integrated type of Authentication in the Azure, then either you should have domain-joined device for accessing the Web Application linked with SQL Database or make the device as federations with ADFS.
So, if you are accessing the Azure Applications from other machines, use the AD-password type authentication mode and its connection string format is given in the same MS Document and this Doc2 for more relevant information on configuring the AD Integrated / Password Type of Authentication mode on Azure Data sources and applications.
AD Password Type Authentication Format:
Server=demo.database.windows.net; Authentication=Active Directory Password; Encrypt=True; Database=sample_db; User Id=your_username#domain.com; Password=<Your__Password>
I've successfully changed my username and password for my neo4j database and I can successfully connect from my app. However now I cannot log in from the desktop browser.
Every attempt to run :server connect returns the same message, indicating that I'm still attempting to connect as user "neo4j", that the database access requires an authenticated connection, and that connection credentials are stored in my web browser.
I've checked everywhere I can think of for where these credentials are stored so I can change the user I am attempting to authenticate with.
Where is this information stored and how can I change it?
This may solve your issue. In the neo4j Desktop window:
Select your Project in the left pane.
Click the Manage button of the appropriate Graph in the right pane.
Click the Administration tab.
Set your new password.
I found the solution. I had to use :server disconnect and then :server connect, which allowed me to re-enter new credentials.
I have created the IIS site and pointed it at the deployment folder. I have enabled stdout logging and this is the error:
info: Microsoft.Extensions.DependencyInjection.DataProtectionServices[0]
User profile is available. Using 'C:\Users\No Managed Code\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
fail: Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler[1]
An exception occurred in the database while iterating the results of a query.
System.Data.SqlClient.SqlException: Cannot open database "KeyStoneDb" requested by the login. The login failed.
Login failed for user 'IIS APPPOOL\No Managed Code'.
So, I added the login to SQL with all the necessary rights. Retested in DEV - fine, but when running IIS I still get the issue. The Application Pool being used is 'No Managed Code'.
Why cant the app not connect to the database?
IIS AppPool accounts are virtual accounts, therefore, they don't actually exist as a normal user on the system.
You can not give access to networked resources using that identity. Shared\network resources like file shares and databases that need to communicate with these accounts need to have the 'domain\machinename$' with appropriate permissions.
Give 'domain\machinename$' appropriate permissions on your DB. That should do it.
I'm using the Swift AWS Mobile Hub Helper to build my iOS app and connect to my DynamoDB database. I can see that after logging in using a Facebook SignInProvider I'm getting an assumed role arn for an authorized role for the table I'm trying to connect to, but when I try to use the load method on my DynamoDBObjectMapper I get an error telling like this:
is not authorized to perform: dynamodb:GetItem on resource
I tried downloading a new base app from the mobile hub page and making no other alterations but to point it to the new table but it had the same error. My colleague is building an android version of our app and he is able to connect to the database and he says that he made no changes to how he connects so I'm unsure as to what is causing the error.
EDIT: I've been looking at the federated identity pool that I'm ostensibly being assigned and the identity id that cognito is assigning my device (the simulator) is appearing there if I search for it with the dataset that my code is creating.
For each table in your Mobile Hub app, Hub creates an IAM role policy, and attaches it to the policy your users assume. If you look under your auth/unauth roles for the app (it will have the Mobile Hub project name in it). You should see a list of attached policies. One of those policies will be for the table you created in Hub. If you want that policy to have expanded capabilities, or in your case give access to a different table. You will either need to edit the policy or create a new policy.
I deployed my asp.net mvc 3 project under IIS 7 (Windows 7). Project contain attach *.mdf DB file in App_Data folder. First I got following error:
Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed.
I removed it so change connection string in my web.config file - remove user instanse=true and in Application Pool -> Addvanced Setting -> Process Model -> Load User Profile set value TRUE and then I got next error:
CREATE DATABASE permission denied in database 'master'.
An attempt to attach an auto-named database for file C:\inetpub\wwwroot\assign\App_Data\AssignmentDB.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
my connection string is
<add name="AssignmentDBEntities" connectionString="metadata=res://*/Models.AssignmentDBModel.csdl|res://*/Models.AssignmentDBModel.ssdl|res://*/Models.AssignmentDBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\AssignmentDB.mdf;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
I don't known how resolve this problem..((
someone can help me?
The account you're using to connect to the database (specified in the connection string) doesn't have a CREATE DATABASE permission. You need to grant this permission in order to be able to create database.
You can just execute sql command (http://msdn.microsoft.com/en-us/library/ms178569.aspx) or use Enterprise Manager to grant permission.
The user you need to grant the permission to is the one specified in the connection string or the account your website runs under if you're using integrated security.