I Made Bad Mistake And Disable All Users In SQL Is There Any Way With cmd Or RegEdit To Enable One User?
32877
I lost the sa password on a machine, and when I log in to the machine directly using an account in the admin group, SQL Server Management Studio will not allow me to log in using Windows authentication.  My plan was to simply log into the server, connect via Windows Authentication, and reset sa to use a new password. Since I cant' connect via Windows Authentication, this won't work.  How else can I reset the sa password?
73
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
30067
I installed SQL Server 2005 sometime ago and forgot the administrator password I set during setup. How can I connect to SQL server now?  EDIT: I think I only allowed Sql Server Authentication. Login with integrated security also does not work.
19178
We have a user table, every user has an unique email and username. We try to do this within our code but we want to be sure users are never inserted (or updated) in the database with the same username of email. I've added a BEFORE INSERT Trigger which prevents the insertion of duplicate users.  CREATE TRIGGER [dbo].[BeforeUpdateUser]    ON  [dbo].[Users]    INSTEAD OF INSERT AS  BEGIN     -- SET NOCOUNT ON added to prevent extra result sets from     -- interfering with SELECT statements.     SET NOCOUNT ON;      DECLARE @Email nvarchar(MAX)     DECLARE @UserName nvarchar(MAX)     DECLARE @UserId int     DECLARE @DoInsert bit      SET @DoInsert = 1      SELECT @Email = Email, @UserName = UserName FROM INSERTED      SELECT @UserId = UserId FROM Users WHERE Email = @Email      IF (@UserId IS NOT NULL)         BEGIN             SET @DoInsert = 0         END      SELECT @UserId = UserId FROM Users WHERE UserName = @UserName      IF (@UserId IS NOT NULL)         BEGIN             SET @DoInsert = 0         END      IF (@DoInsert = 1)         BEGIN             INSERT INTO Users             SELECT                             FirstName,                             LastName,                             Email,                             Password,                             UserName,                             LanguageId,                            Data,                             IsDeleted                         FROM INSERTED         END     ELSE         BEGIN             DECLARE @ErrorMessage nvarchar(MAX)             SET @ErrorMessage =                           'The username and emailadress of a user must be unique!'             RAISERROR 50001 @ErrorMessage         END  END   But for the Update trigger I have no Idea how to do this. I've found this example with google:  But I don't know if it applies when you update multiple columns at once.  EDIT:  I've tried to add a unique constraint on these columns but it doesn't work:  Msg 1919, Level 16, State 1, Line 1 Column 'Email' in table 'Users' is of a type  that is invalid for use as a key column in an index.
49035
I need a command to list all users as well as commands to add, delete and modify users from terminal - any commands that could help in administrating user accounts easily by terminal.
62975
I'tm trying to show in SQLcmd window the results of these queries:  SELECT SYSDATETIME() AS "date";  PRINT 'EXTRAÍDO POR:' SELECT SUSER_NAME() AS "Owner"  PRINT 'PASSWORD SETTINGS'; exec xp_loginconfig;  PRINT 'PASSWORD SETTINGS'; select * from sys.sql_logins;   And using this command in SQLcmd:  sqlcmd -S myServer -i inputpath -s, -o outputPath(like C:\log.xls) -e   So the sqlcmd output the file and does not show nothing in sqlcmd screen. How can i print these "Print" commands in the sqlcmd screen? (command promt).  When I run it on SSMS works well, like:  (1 row affected) OWNER:  (1 row affected) PASSWORD SETTINGS  (8 rows affected) PASSWORD SETTINGS  I would like to show in the prompt command this, like in the SSMS.  Thanks!
31030
I'm want to grant a user administrative rights to one application on Windows 7. I don't want them to be able to have full admin rights, but admin rights are required for one of the applications they need to use.   Is there a way to set up a batch script or something where the user won't know it's being run as admin?  Or is there another way?  How can I accomplish this?
66298
Today, on my Centos server I tried to add a user but got the following error:  -bash: /usr/sbin/useradd: Input/output error   How do I fix it?
66411
This seems to be a stupid question but despite some research I was unable to find any information regarding this only (possibly due to using the wrong terminology).  Is it possible to log multiple server logins (sql server authentication) to a single database user (which has permissions assigned by being member of a database role)?  I have dozens of sql logins (sql server authentication) which need to read one setting from a central database and I'd rather map all these logins to a single DB user in the target database than create an own DB user for each login.  If yes, what would be the correct T-SQL syntax?
28054
When I start SQL Server Management Studio 2008, I get an error that's been around forever and is documented .  One of the suggestions to fix it that actually worked was to start SSMS with Run as Administrator. So I modified the properties of the shortcut to always run it as the administrator.  The only annoyance is that I get a prompt every single time asking whether I really want to do it. Is there a way to tell just this one program (SSMS) to not pop up the prompt, while keeping this behavior for other apps?
80206
I have the following system:  $ lsb_release -a Distributor ID: Ubuntu Description:    Ubuntu 17.10 Release:        17.10 Codename:       artful  $ gdm3 --version GDM 3.26.1   I would like to disable the user list in GDM and enter my user name and password to log-in. I have already searched a lot but did not find any valuable solution.  How can I achieve this?
87224
My scenario: I have some groups with full - and inappropriate - access to all Sql Server instances. I want to change that.  My Plan: Give full and automatic access to all databases (it is customer databases and this groups must be allowed to change any property if necessary).  Restrict permissions on Instance Level, because this groups should not be allowed to do any unexpected change on instance properties.  I don't want to create a user in databases, because our external customer could drop the user ( they have db_owner permission )  Someone have any idea? Tks
3846
In the past there has been sudo /etc/init.d/mysql reset-password, (1) is manually restarting and setting the password with an sql command again required? (2)  (1)  (2)
88228
According to the , you can harden a MySQL server by adding passwords, or removing the anonymous accounts.      If you want to prevent clients from connecting as anonymous users   without a password, you should either assign a password to each   anonymous account or else remove the accounts.   Before hardening, my users table looked like this.   mysql&gt; select user,host,password from mysql.user; +------------------+-----------+-------------------------------------------+ | user             | host      | password                                  | +------------------+-----------+-------------------------------------------+ | root             | localhost | *F3A2A51A9B0F2BE246XXXXXXXXXXXXXXXXXXXXXX | | root             | gitlab    |                                           | | root             | 127.0.0.1 |                                           | | root             | ::1       |                                           | |                  | localhost |                                           | |                  | gitlab    |                                           | | debian-sys-maint | localhost | *95C1BF709B26A5BAXXXXXXXXXXXXXXXXXXXXXXXX | | myuser           | localhost | *6C8989366EAF75BB6XXXXXXXXXXXXXXXXXXXXXXX | +------------------+-----------+-------------------------------------------+   I've remove all anonymous accounts, so that the user table now looks like this.  (I'm using puppet to manage the users, but puppet effectively performs a DROP USER command).   mysql&gt; select user,host,password from mysql.user; +------------------+-----------+-------------------------------------------+ | user             | host      | password                                  | +------------------+-----------+-------------------------------------------+ | root             | localhost | *F3A2A51A9B0F2BE246XXXXXXXXXXXXXXXXXXXXXX | | debian-sys-maint | localhost | *95C1BF709B26A5BAXXXXXXXXXXXXXXXXXXXXXXXX | | myuser           | localhost | *6C8989366EAF75BB6XXXXXXXXXXXXXXXXXXXXXXX | +------------------+-----------+-------------------------------------------+   Why is it that I am still able to login to my test system without a username or a password? What do I need to do to prevent any unwanted users from logging in?   root@gitlab:~# mysql Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 98 Server version: 5.5.32-0ubuntu0.12.04.1 (Ubuntu) .... mysql&gt;    Update:  I've also just discovered that I can login as root, without entering a password.  Update2: I found  which has some good information, but does not solve the issue.   There are no anonymous users.  mysql&gt; select user,host,password from mysql.user where user=''; Empty set (0.00 sec)   I login as root@localhost.  mysql&gt; select USER(),CURRENT_USER(); +----------------+----------------+ | USER()         | CURRENT_USER() | +----------------+----------------+ | root@localhost | root@localhost | +----------------+----------------+    I do not have a default password, or skip-grant-tables defined in my.cnf  root@gitlab:~# cat /etc/mysql/my.cnf |grep -i 'skip-grant-tables'|wc -l 0 root@gitlab:~# cat /etc/mysql/my.cnf |grep -i 'pass'|wc -l 0   Update3:  I have tried performing these steps with puppet, (which should perform a flush privileges automatically). I have also manually flushed privileges and also tried restarting mysql.   Update4: I've also tried changing the mysql root password and flushed privileges. No luck, I can still log in as any user without a password.
94845
This afternoon I set up a Win Server 2008 R2 system for use with Team Foundation source code control. In order to give my team-mates the right to connect, I had to create a user account for each person, 10 in total. (I can't, and I don't want to create a domain).  Now, after doing this, all user accounts are displayed in the login screen.  What can I do so that all the accounts are not displayed there?
27677
Can we direct change it from sql database? if yes then how?  or  any other solution?
70392
We're using Virtualmin to do most of our database management, but apparently it has a bug that sets a user's permissions too broadly in some cases. Also, the MySQL manual mentions nothing about restricting a user's ability to see other databases with the "show databases" command.   When I run "show grants for 'user'@'localhost';" I get this:  +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Grants for user@localhost                                                                                                                                                                                                                   | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, CREATE TEMPORARY TABLES ON *.* TO 'user'@'localhost' IDENTIFIED BY PASSWORD 'ENCRYPTED'                                                                | | GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `database`.* TO 'user'@'localhost' WITH GRANT OPTION | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+   This is even after I've run "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, CREATE TEMPORARY TABLES ON database.* to 'user'@'localhost';"