I'm trying to run a SQL Server Agent Job manually but keep getting an error that basically says the domain account is denied on sp_send_dbmail.
The job has multiple steps that run stored procedures. The domain account is sysadmin and it's also the owner of the job. Each step in the job runs as the sysadmin account and my account is also a sysadmin.
It should run under (I assume) sysadmin security context, but I'm lost why it keeps failing.
This is not a pure answer but a way to see what's going on :
On the machine that sends mail , please run :
EXEC master..xp_cmdshell 'whoami'
then see who is the user which tries to send mail and grant permission to that user.
Also ,go to the services.msc to your instance , right click , properties and go to logon as and see if that user has permissions.
Related
I've an application on windows forms that needs to connect to a remote server with a static ip, however I already installed mysql on the server, provided the next command
GRANT ALL PRIVILEGES ON *.* TO 'root'#'%' IDENTIFIED BY 'password' WITH GRANT OPTION; FLUSH PRIVILEGES;
and also put an exception in Windows Firewall, but I'm still unable to connect, I don't know if there is something else to do!, I forgot to say it is a Windows Server 2012 R2
This is not the issue with previliges of user. This is about connection rights. LIke mostly on CPanel we have an option of Remote MySQL. Under this option we either have to provide ip address which we want to allow to connect to mysql or wild card mask % to allow any ip to connect to the server. Check with your hosting how it allows you to connnect. yes these previliges are necessary thay you have given. that is ok but check Remote MySQl if you have cPanel.
Thanks
Check your logs and trap your errors.
Confirm your app can reach the sql port and connect. (From the windows machine, can you telnet to the sql port on the sql server?) If not, look at your firewall, and verify your sql instance is bound to a public ip as Bernd suggests.
Once you know the host can reach the sql server, verify your app is actually connecting. Trap errors from connect functions and read them out.
Then verify the credentials are accepted. Again, trap any errors and read them out in your program.
Then, when you're processing a sql statement, trap any errors and read them out to yourself in your program.
(You may find it useful to write a log file from your program containing any errors you detect on any line of code interacting with your database)
Once you've narrowed down where your issue actually is, a solution will probably present itself. Or at least you'll have narrowed it down, and can update us with a specific error message from where the failure has occured.
Good luck!
How do I prevent WAN access to a particular database in SQLyog? I am able to grant full access to particular DB's, but not able to prevent them. I have a Web APP that runs on an internal server and accesses MySQL on the same server. I have created a SQL user with my workstations IP, but I am receiving access denied from dbconnect when I run the APP from my workstation.
Thanks,
Tony Cripps
MySQL does not allow connections from anything other than what you've specified. If you want to disallow access from a particular IP or network, then that mean that you've already gone and granted access to them.
Review the CREATE USER syntax, particularly the section on specifying hostnames.
Review the user accounts that you've already created:
SELECT user, host, password FROM mysql.user;
And then re-create them as necessary.
Other than than that, if you want to completely disallow WAN access then you should be looking at your firewall settings, not MySQL.
When I try to deploy the Adventure Works DW 2008 cube, I get the following error:
OLE DB error: OLE DB or ODBC error: Login failed for user 'SpecialSQLServerServiceAccount'.; 28000; Cannot open database "AdventureWorksDW2008R2" requested by the login. The login failed.; 42000.
Basically, I have a this account (SpecialSQLServerServiceAccount) which I created and used when installing SQL Server. This account was then given the least amount of permissions by MSSQLSERVER to run all of the services needed.
But alas, it is not working when I try to deploy my Adventure Works DW 2008. What I want to know is what permissions need to be given to my service account or which roles should I add to it and where can I do this? I need the least amount of permission to get the thing deploying.
Try running this in SSMS...
USE [AdventureWorksDW]
GO
CREATE USER [SpecialSQLServerServiceAccount] FOR LOGIN [SpecialSQLServerServiceAccount]
GO
USE [AdventureWorksDW]
GO
EXEC sp_addrolemember N'db_datareader', N'SpecialSQLServerServiceAccount'
GO
Make sure you have the login created on the server first.
Currently user using connections to both TEST and PROD instances using MS Access, and everything goes well. By using ABC user. Now user having problems with APPS user in TEST .
Also, user having the same problem with user XYZ in PROD instance. This user has the ‘SELECT ANY TABLE’ privilege, so it should be able to see the tables, but doesn’t work from MS Access.
Please suggest us.
If you're able to connect via a SQL connection (I'm assuming ODBC) then you'll be using a predefined set of credentials (i.e. you'll be passing a username and password to Access; probably through the connection string).
Chances are that if your user is unable to get into the database directly, their network (AD?) account is not configured with the same elevated privileges that the ODBC connection has.
I installed an instance of MySQL 5.1. The service runs fine when I log on as Administrator. But I am unable to run the instance using a local user account. The instance runs in 'localhost'. I get Error 5: Access Denied when I try to start the service from the local account. Should I elevate privileges to run the service? How do I do it? I tried to Run As Admin and it still doesn't work.
See MySQL docs: you need to CREATE USER and GRANT permissions specifically to the user#localhost.