如何恢复链接ALTER DATABASE [eshop] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
时间: 2023-12-12 07:06:04 浏览: 237
要恢复链接ALTER DATABASE [eshop] SET SINGLE_USER WITH ROLLBACK IMMEDIATE,可以使用以下命令:
```
ALTER DATABASE [eshop] SET MULTI_USER;
```
这将允许多个用户访问数据库。请注意,执行此命令将取消先前使用`SINGLE_USER`选项的任何连接。如果您需要在恢复链接之前备份数据库,请确保在执行此命令之前重新设置单用户模式。
相关问题
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE sdle9 SET READ_COMMI' at line 1
It seems like you are trying to execute multiple SQL statements at once. The first statement is incomplete and the second statement is not properly separated from the first one.
To fix this error, you should separate each SQL statement with a semicolon (;) and execute them one by one. Here is an example:
```
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
ALTER DATABASE sdle9 SET READ_COMMITTED_SNAPSHOT ON;
```
This will execute the first statement to set the database in single-user mode and roll back any active transactions. Then, the second statement will set the database to use the read committed snapshot isolation level.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET SINGLE_USER WITH ROLLBACK IMMEDIATE GO ALTER DATABASE sdle9 SET READ_COMMI' at line 1 怎么解决
It looks like you are using SQL Server syntax instead of MySQL syntax.
For MySQL, you can achieve similar functionality by using the following syntax:
```
SET autocommit=0;
START TRANSACTION;
-- your SQL statements go here
COMMIT;
```
This will set autocommit to off, start a new transaction, execute your SQL statements, and then commit the transaction. If any errors occur during the transaction, you can use the ROLLBACK command to undo the changes.
Alternatively, you can try separating your SQL statements with a semicolon (;) instead of using the GO keyword. The semicolon is the standard statement separator for MySQL.
阅读全文