Unable to Login to Azure SQL Database from Tableau with email address - azure-sql-database

Something strange is occurring when trying to login to Azure SQL Database from Tableau with email address.
I was able to login a few days ago, but not today.
I create an account on the Azure SQL Database using the following:
CREATE USER [xxxxx.xxxxx#company.com] WITH PASSWORD = 'bA8F8%z^10AX'
ALTER ROLE db_datareader ADD MEMBER [xxxxx.xxxxx#company.com];
ALTER ROLE db_datawriter ADD MEMBER [xxxxx.xxxxx#company.com];
I was able to login no problem from the following login
Today I'm getting the error:
[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot open server "company.com" requested by the login. The login failed.
Invalid username or password.
This is strange because I created a dummy user as follows:
CREATE USER Peter with PASSWORD = 'gRAnIAndoLKi#1'
ALTER ROLE db_datareader ADD MEMBER Peter
ALTER ROLE db_datawriter ADD MEMBER Peter
I don't have any problems logging in with the user Peter. Therefore, it leads me to think that Tableau has as issue with logging in with email addresses..
Any thoughts?

[Microsoft][ODBC Driver 17 for SQL Server] [SQL Server] Cannot open server "company.com" requested by the login. The login failed.
Invalid username or password.
Cause:
In Azure login, after # symbol it is considering as server name is provided. Company.com is a portion of your user's name that is supplied after the # symbol, therefore it will initially speak to the gateway that is resolved from your server's name and ask for the information of Company.com.
Resolution:
Add the #myserver to the end of the username, user#Company.com#yourservername.

Related

regarding oracle database "sysdba" user and creating a new user

I am very much new to oracle database, please forgive me for any technical errors in my question. I am using oracle 19c and I think my password for "system" user is different than the password for "sysdba". At the time of installation I used the same password every time but now while connecting to system or "\ as sysdba" , there is no problem connecting but when I type the password for "orcl_listener" or "orcl" or "sysdba" , the password is wrong . for example:
conn sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
when I create a new connection in SQL Developer, I use a username as a system, and the password is correct.
success
when I create a new connection in SQL Developer, I use username as \ as sysdba and password is correct .success
when I create a new connection in SQL Developer, I use username as sysdba and password is correct .not success and error says Status: Failure -Test failed: ORA-01017: invalid username/password; logon denied
.I am such a new user, if possible please provide me basic details of oracle databases in the simplest ways.
Now the second problem is that after creating a new connection in SQL developer using system username as its password is working, I expanded connection and at the bottom, I right-clicked on other users and created a new user with username "hr" and here it says "ORA-65096: invalid common user or role name".when I used c## as prefix no error occurs but I don't want any c##, it means it has to be a local user but where is option to create a local user?
please help me.
To understand common users and local users you have first to understand multitenant architecture in Oracle: container database (CDB) and pluggable databases (PDB).
In multitenant architecture you can only create a local user in a PDB.
To create a local user connected with SQL*Plus as user SYS:
Check your current CDB/PDB
show con_name
List existing PDBS
show pdbs
Go to an existing PDB:
alter session set container=mypdb;
Check your current PDB
show con_name
Create a local user in the current PDB and grant some basic privileges:
create user myuser identified by "mypwd" quota unlimited on tablespace myts;
grant create session to myuser;
grant create table to myuser;
To connect directly with SQL*Plus to this PDB you must use the Oracle Net service for this PDB:
sqlplus myuser/mypwd#myhost:myport/mypdb

Create login with execute

I am working on a project and I have access to SQL Server as external user with limited privileges.
When I want to create a login for example with this command, I get permission denied:
CREATE LOGIN [login] WITH PASSWORD=N'test', DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF)
However when I try to create a login with this command I can make it and also I have privileges now to enable xp_cmd shell as well:
EXECUTE('EXECUTE(''CREATE LOGIN [test5] WITH PASSWORD=N''''test'''',
DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF'') AT "hostname\domain"')
EXECUTE('EXECUTE(''ALTER SERVER ROLE [sysadmin] ADD MEMBER [test5]'')
EXECUTE('EXECUTE(''ALTER SERVER ROLE [db_owner] ADD MEMBER [test5]'')
Can someone please explain why is that?
EXECUTE('string sql statement') AT "hostname\domain" == the 'string sql statement' is a pass-through command executed at the linked server "hostname/domain".
Has someone created a loop-back linked server (a linked server that points to the sql instance itself)?
Linked servers have their own security configuration/settings. If the security of the linked server is configured (for any login) to be made under the security context of a privileged login(eg. sa) then exec('') at linkedserver will be executed with way more/elevated permissions (than expected). This is a major security issue/hole.
Check the security of the linked server and change accordingly (and do you really need a loopback linked server?)

Microsoft SQL Server Management Studio dbcreator permission

RE: Permissions
Program - Microsoft SQL Server Management Studio v.17.1
When attempting to create a new database through Object Explorer, I get the following error:
Screenshot #1
To fix this, I did the following and got another error:
Screenshot #2
I have searched the internet and all posts and articles say that I need to log in as administrator or SA. I am logged in as administrator and still can not gain permission to create a database.
How do I assign permission to the SA account to create a new database?
Problem here is that you are logged in with the local Windows Administrator account. You have two logins for your SQL Server instance as can be seen in your Image #2. One is SA (SQL Admin). The other is BUILTIN\USERS. That is a default group which every user that logs into the machine will be a part of. But unless you give that group permissions, or create other logins (I recommend this), you will be very limited to what you can do.
As you have found, that user group cannot modify permissions, especially for the SA user. The SA user is special, you cannot modify SA permissions at all. This is why you are receiving errors (partly because you don't have permissions to change them with the user you are logged in as, and partly because SA permissions cannot be modified).
The resolution to your issue is to login with the SA account. You will need to choose "SQL Login" at the login screen, as opposed to Windows login. SSMS will prompt you for a password. This password was configured by the person who installed the SQL instance. If the person who installed SQL Server did not specify a password, it will be most likely be a blank password or "Password123".
Once you are logged into the SA account, you can create new SQL or Windows Authentication logins and and provision them permissions as needed.

SQL IIS application login fails for user

I am scratching my head here and I need a hand with this. Please save my sanity!
1
I can log into SSMS with the username and it works.
I can open the ODBC/System DSN and test the connection using the same username and it works.
3
I have the vtimecard.ini configured with the username and password IDENTICAL to the login for SQL and that used for the 2 logins that work...
[ODBC]
DSN=
Driver=SQL Server
Server=MLAERP01\VTIMECARD
Database=vTimeCard
UID=vtc2
PWD=
BUT once I try to access the website, it fails.
Details: Global database error Open (global): 'Login failed for user 'vtc2'.' (D=, D=SQL Server, S=MLAERP01\VTIMECARD, D=vTimeCard, U=vtc2)
and when I check the SQL server log it gives:
Login failed for user 'vtc2'. Reason: Password did not match that for the login provided. [CLIENT: ] Error: 18456, Severity: 14, State: 8
Please direct me what I need to look at with this. I am not that versed in SQL and webApps. Any help is good help!

what's the server role for database mail on sql server 2008?

I have create a account and assign server role as public.
the assign user mapping on database mydb as dbo, and for msdb also as dbo.
with User mapping setting on msdb, I checked following role:
DatabaseMailUserRole
db_owner
public
then my app login with this account and try to send out email with database mail profile.
and I got error as:
System.Data.SqlClient.SqlException: The EXECUTE permission was denied on the object 'sp_send_dbmail', database 'msdb', schema 'dbo'.
If I assign server role sysadmin to this account. then it's working fine.
but I don't want to assign sysadmin to this account. how to resolve this issue?
Weird thing is I also try it on testing server. that account even not in DatabaseMailUserRole on msdb, it's working fine.
The only difference on 2 sql sever box is SMTP authentication setting:
On testing box, is set as "Basic Authentication"
On production box, is set as "Windows Authentication using Database Engine service credentials"
Hi Bridge. Thanks. run EXEC msdb.dbo.sysmail_help_principalprofile_sp and got following on production:
principal_id principal_name profile_id profile_name is_default
11 guest 1 sqlservice 0
12 mydomainaccount 1 sqlservice 0
On staging, no result.
To send Database mail, users must be a user in the msdb database and a member of the DatabaseMailUserRole database role in the msdb database. To add msdb users or groups to this role use SQL Server Management Studio or execute the following statement for the user or role that needs to send Database Mail.
EXEC msdb.dbo.sp_addrolemember #rolename = 'DatabaseMailUserRole'
,#membername = '<user or role name>';
GO
Source: http://technet.microsoft.com/en-us/library/ms188719%28v=sql.100%29.aspx