Experimental thirteen MySQL multi-user transaction management

Experimental thirteen MySQL multi-user transaction management

First, the  Experiment:

1, using the transaction mechanism

2, the lock mechanism

Second, the  pilot project: staff management database

Staff management for enterprise database management, database named YGGL in, YGGL database consists of three tables: Employees (employee information table), Departments (department information table), Salary (staff salaries Fact Sheet).

Third, the  experimental procedures required to complete the following :( command)

1, all the rights of all objects in the database YGGL grant a new user u1 @ localhost;

 

 

2, off automatic submission;

 

 

3. Check whether the Departments table storage engine is Innodb, if not, modify the Innodb;

 

 

4, modified terminator;

 

 

5, create what matters: 1) transaction begins 2) insert a record into the Departments table; 3) modifying a record; 4) terminator perform operations 5) using a select statement to see departments recorded in the table; 6) to open a new window with the u1 log in and view the departments table records check for the difference, think about why? 7) transaction retraction; 8) Terminator execution; 9) again using the select statement to see the departments table records; and u1 user window again to see the departments table records the outcome?

 

 

 

 

 

 

 

 

6, to create what matters: 1) transaction begins 2) insert a record into the Departments table; 3) modifying a record; 4) terminator perform operations 5) using a select statement to see departments recorded in the table; 6) to open a new window with the u1 log in and view the departments table records check for the difference, think about why? 7) the transaction is committed; 8) Terminator execution; 9) again using the select statement to see the departments table records; and u1 user window again to see the departments table records the outcome?

 

 

 

 

 

 

 

7、   创建一下事务:1)事务开始 2)向Departments表中插入一条记录;3)修改一条记录;4)设置保存点5)删除一条记录6)回滚到保存点7)插入一条记录8)事务提交;完成;使用select语句查看本事务中2)3)5)7)中的四个操作哪些成功了;

 

 

 

8、   查看事务的隔离等级;

 

 

9、   查看salary表的存储引擎是否为MyISAM,如果不是进行修改;

 

 

10、                使用root用户在salary表上设置只读锁;

 

 

11、                使用 root用户对Salary表分别进行查询和修改操作,看是否能成功;

 

 

12、                使用u1用户对Salary表分别进行查询和修改操作,看是否能成功;

 

 

13、                使用root用户对Salary设置写锁定;

 

 

14、                使用 root用户对Salary表分别进行查询和修改操作,看是否能成功;

 

 

15、                使用u1用户对Salary表分别进行查询操作,看是否能成功。

 

 

 

四、  实验报告要求

1、 实验报告格式要求

包括内容:标题、实验内容、实验步骤、实验中遇到的问题及解决方案

2、 实验报告内容要求

(1)     标题参看实验指导标题+“实验报告”,如“实验一 MySQL的安装与命令初步实验报告”;

(2)     实验内容与实验指导中相同;

(3)     实验步骤中将自己实验中的每个步骤的命令和操作结果显示界面进行截图完善。

(4)     实验中遇到的问题及解决方案中如实地将自己的问题的解决过程记录出来。

3、 实验报告提交要求

每次实验课结束之后,每个人需要提交实验报告,实验报告命名为:学号姓名 

五、  补充说明

 

Guess you like

Origin www.cnblogs.com/lvwuwa/p/11128587.html