- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我有一个复杂的查询,它创建了一个可能需要 5 秒或更长时间才能运行的临时表。当同时在类似表上运行另一个事务时,这似乎会导致死锁。我无法在本地复制,但在生产中,我可以每隔几天让它发生 1 次。 (我记录了 mysql 错误)
查询非常复杂(显示在页面底部);但你不需要理解逻辑;只是它从一堆表和连接中进行选择,并且可能需要一段时间才能运行。
我还有一个事务可以插入到许多相同的表中。我偶尔会收到 mysql 错误 1213: Deadlock found when trying to get lock;尝试重启事务。
这是交易的伪代码
START TRANSACTION
INSERT INTO phppos_sales
INSERT MANY RECORDS INTO phppos_sales_items
INSERT MANY RECORDS INTO phppos_sales_items_taxes
INSERT MANY RECORDS INTO phppos_sales_payments
END TRANSACTION
我该如何解决这个死锁?我尝试将 isolation level 更改为 READ UNCOMMITTED 但 mysql 设置不允许这样做;而且我需要在我无法控制服务器的各种环境中进行这项工作。
更改隔离级别时出错:
Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
INNODB 引擎状态:
mysql> SHOW ENGINE INNODB STATUS;
| Type | Name | Status |
| InnoDB | |
=====================================
140520 12:00:17 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 15 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 1766819 1_second, 1766816 sleeps, 167043 10_second, 100947 background, 100945 flush
srv_master_thread log flush and writes: 1776023
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 236559, signal count 288374
Mutex spin waits 546890, rounds 1796579, OS waits 33216
RW-shared spins 205374, rounds 5519210, OS waits 176937
RW-excl spins 5661, rounds 841678, OS waits 23933
Spin rounds per wait: 3.29 mutex, 26.87 RW-shared, 148.68 RW-excl
------------------------
LATEST FOREIGN KEY ERROR
------------------------
140520 11:27:44 Transaction:
TRANSACTION 86D125F, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
15 lock struct(s), heap size 3112, 6 row lock(s), undo log entries 2
MySQL thread id 1910245, OS thread handle 0x7fbf0042e700, query id 56114114 php-pos-web 10.181.16.33 phppoint update
INSERT INTO `phppos_sales_items_taxes` (`sale_id`, `item_id`, `line`, `name`, `percent`, `cumulative`) VALUES (11763, 1115, 3, 'PST', '8.000', '0')
Foreign key constraint fails for table `phppoint_fatpanda`.`phppos_sales_items_taxes`:
,
CONSTRAINT `phppos_sales_items_taxes_ibfk_1` FOREIGN KEY (`sale_id`) REFERENCES `phppos_sales_items` (`sale_id`)
Trying to add in child table, in index `PRIMARY` tuple:
DATA TUPLE: 8 fields;
0: len 4; hex 80002df3; asc - ;;
1: len 4; hex 8000045b; asc [;;
2: len 4; hex 80000003; asc ;;
3: len 3; hex 505354; asc PST;;
4: len 8; hex 8000000000080000; asc ;;
5: len 6; hex 0000086d125f; asc m _;;
6: len 7; hex 00000000000000; asc ;;
7: len 4; hex 80000000; asc ;;
But in parent table `phppoint_fatpanda`.`phppos_sales_items`, in index `PRIMARY`,
the closest match we can find is record:
PHYSICAL RECORD: n_fields 11; compact format; info bits 0
0: len 4; hex 80002df1; asc - ;;
1: len 4; hex 8000049a; asc ;;
2: len 4; hex 80000001; asc ;;
3: len 6; hex 0000086cfd29; asc l );;
4: len 7; hex f400000216012c; asc ,;;
5: len 0; hex ; asc ;;
6: len 0; hex ; asc ;;
7: len 11; hex 8000000000010000000000; asc ;;
8: len 11; hex 8000000000100000000000; asc ;;
9: len 11; hex 80000000002d0000000000; asc - ;;
10: len 4; hex 80000000; asc ;;
------------------------
LATEST DETECTED DEADLOCK
------------------------
140520 11:27:44
*** (1) TRANSACTION:
TRANSACTION 86D11A3, ACTIVE 2 sec fetching rows
mysql tables in use 9, locked 9
LOCK WAIT 364 lock struct(s), heap size 47544, 80177 row lock(s)
MySQL thread id 1910243, OS thread handle 0x7fbeb2090700, query id 56113840 10.181.26.42 phppoint Copying to tmp table
CREATE TEMPORARY TABLE phppos_sales_items_temp
(SELECT phppos_sales.deleted as deleted,phppos_sales.deleted_by as deleted_by, sale_time, date(sale_time) as sale_date, phppos_sales_items.sale_id, comment,payment_type, customer_id, employee_id,
phppos_items.item_id, NULL as item_kit_id, supplier_id, quantity_purchased, item_cost_price, item_unit_price, category,
discount_percent, (item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100) as subtotal,
phppos_sales_items.line as line, serialnumber, phppos_sales_items.description as description,
(item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)+(item_unit_price*quantity_purchased-item_unit_price*quantity_purchased*discount_percent/100)*(SUM(CASE WHEN cumulative != 1 THEN percent ELSE 0 END)/100)
+(((item_unit_price*quantity_purchased-item_unit_price*quanti
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 454941 page no 114 n bits 408 index `location_id` of table `phppoint_fatpanda`.`phppos_sales` trx id 86D11A3 lock mode S waiting
Record lock, heap no 335 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 4; hex 80000001; asc ;;
1: len 4; hex 80002df3; asc - ;;
*** (2) TRANSACTION:
TRANSACTION 86D125D, ACTIVE 0 sec inserting
mysql tables in use 1, locked 1
23 lock struct(s), heap size 3112, 12 row lock(s), undo log entries 10
MySQL thread id 1910245, OS thread handle 0x7fbf0042e700, query id 56114091 php-pos-web 10.181.16.33 phppoint update
INSERT INTO `phppos_sales_items_taxes` (`sale_id`, `item_id`, `line`, `name`, `percent`, `cumulative`) VALUES (11763, 1178, 2, 'GST', '5.000', '0')
*** (2) HOLDS THE LOCK(S):
RECORD LOCKS space id 454941 page no 114 n bits 408 index `location_id` of table `phppoint_fatpanda`.`phppos_sales` trx id 86D125D lock_mode X locks rec but not gap
Record lock, heap no 335 PHYSICAL RECORD: n_fields 2; compact format; info bits 0
0: len 4; hex 80000001; asc ;;
1: len 4; hex 80002df3; asc - ;;
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
RECORD LOCKS space id 454945 page no 386 n bits 288 index `PRIMARY` of table `phppoint_fatpanda`.`phppos_sales_items_taxes` trx id 86D125D lock_mode X insert intention waiting
Record lock, heap no 1 PHYSICAL RECORD: n_fields 1; compact format; info bits 0
0: len 8; hex 73757072656d756d; asc supremum;;
*** WE ROLL BACK TRANSACTION (2)
------------
TRANSACTIONS
------------
Trx id counter 86E47F7
Purge done for trx's n:o < 86E45C0 undo n:o < 0
History list length 1418
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 86E47F6, not started
MySQL thread id 1913171, OS thread handle 0x7fbeb2090700, query id 56205829 10.181.26.42 phppoint
---TRANSACTION 0, not started
MySQL thread id 1913095, OS thread handle 0x7fbf005b4700, query id 56205830 localhost root
SHOW ENGINE INNODB STATUS
--------
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
3599456 OS file reads, 9300371 OS file writes, 3988632 OS fsyncs
0.27 reads/s, 16384 avg bytes/read, 13.07 writes/s, 7.27 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 84, seg size 86, 55915 merges
merged operations:
insert 68506, delete mark 4761, delete 38
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 2212699, node heap has 751 buffer(s)
5050.86 hash searches/s, 624.09 non-hash searches/s
---
LOG
---
Log sequence number 184365806376
Log flushed up to 184365806376
Last checkpoint at 184365791715
0 pending log writes, 0 pending chkp writes
2149282 log i/o's done, 3.47 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 1098907648; in additional pool allocated 0
Dictionary memory allocated 62951505
Buffer pool size 65536
Free buffers 1
Database pages 64784
Old database pages 23894
Modified db pages 88
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 4073451, not young 0
0.07 youngs/s, 0.00 non-youngs/s
Pages read 3592230, created 1542046, written 6130789
0.27 reads/s, 18.00 creates/s, 6.40 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 64784, unzip_LRU len: 0
I/O sum[382]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 15866, id 140457065543424, state: sleeping
Number of rows inserted 77431960, updated 1673031, deleted 160450, read 4825684197
1103.93 inserts/s, 2.53 updates/s, 0.00 deletes/s, 7772.15 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
|
+-------
查询这是死锁的一部分:(连同上面的交易)
CREATE temporary TABLE phppos_sales_items_temp
(SELECT
phppos_sales.deleted AS deleted,
phppos_sales.deleted_by AS deleted_by,
sale_time,
Date(sale_time) AS sale_date,
phppos_sales_items.sale_id,
comment,
payment_type,
customer_id,
employee_id,
phppos_items.item_id,
NULL AS item_kit_id,
supplier_id,
quantity_purchased,
item_cost_price,
item_unit_price,
category,
discount_percent,
( item_unit_price * quantity_purchased -
item_unit_price * quantity_purchased *
discount_percent / 100 ) AS subtotal,
phppos_sales_items.line AS line,
serialnumber,
phppos_sales_items.description AS description,
( item_unit_price * quantity_purchased -
item_unit_price * quantity_purchased *
discount_percent / 100 ) + (
item_unit_price * quantity_purchased -
item_unit_price * quantity_purchased *
discount_percent
/ 100 ) * ( Sum(CASE
WHEN cumulative != 1 THEN percent
ELSE 0
end) / 100 ) + ( ( (
item_unit_price * quantity_purchased
-
item_unit_price * quantity_purchased
*
discount_percent / 100 ) * (
Sum(CASE
WHEN cumulative != 1 THEN
percent
ELSE 0
end) / 100 ) + (
item_unit_price * quantity_purchased
-
item_unit_price *
quantity_purchased
*
discount_percent /
100
)
)
* ( Sum(CASE
WHEN
cumulative = 1 THEN percent
ELSE
0
end)
)
/ 100 )
AS total,
( item_unit_price * quantity_purchased -
item_unit_price * quantity_purchased *
discount_percent / 100 ) * (
Sum(CASE
WHEN cumulative != 1 THEN percent
ELSE 0
end) / 100 ) + ( ( ( item_unit_price * quantity_purchased -
item_unit_price * quantity_purchased *
discount_percent / 100 ) * ( Sum(
CASE
WHEN cumulative != 1
THEN
percent
ELSE 0
end) / 100 ) + (
item_unit_price * quantity_purchased
-
item_unit_price * quantity_purchased
*
discount_percent / 100 ) ) * ( Sum(
CASE
WHEN cumulative = 1 THEN percent
ELSE 0
end) ) / 100 ) AS tax,
( item_unit_price * quantity_purchased -
item_unit_price * quantity_purchased *
discount_percent / 100 ) - (
item_cost_price * quantity_purchased ) AS profit
FROM phppos_sales_items
INNER JOIN phppos_sales
ON phppos_sales_items.sale_id = phppos_sales.sale_id
INNER JOIN phppos_items
ON phppos_sales_items.item_id = phppos_items.item_id
LEFT OUTER JOIN phppos_suppliers
ON phppos_items.supplier_id = phppos_suppliers.person_id
LEFT OUTER JOIN phppos_sales_items_taxes
ON phppos_sales_items.sale_id =
phppos_sales_items_taxes.sale_id
AND phppos_sales_items.item_id =
phppos_sales_items_taxes.item_id
AND phppos_sales_items.line =
phppos_sales_items_taxes.line
WHERE sale_time BETWEEN "2014-04-01 00:00:00" AND "2014-04-30 23:59:59"
AND phppos_sales.location_id = '1'
AND phppos_sales.store_account_payment = 0
GROUP BY sale_id,
item_id,
line)
UNION ALL
(SELECT phppos_sales.deleted
AS
deleted
,
phppos_sales.deleted_by
AS deleted_by,
sale_time,
Date(sale_time)
AS
sale_date,
phppos_sales_item_kits.sale_id,
comment,
payment_type,
customer_id,
employee_id,
NULL
AS
item_id,
phppos_item_kits.item_kit_id,
''
AS
supplier_id,
quantity_purchased,
item_kit_cost_price,
item_kit_unit_price,
category,
discount_percent,
( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased * discount_percent / 100 )
AS
subtotal,
phppos_sales_item_kits.line
AS
line,
''
AS
serialnumber,
phppos_sales_item_kits.description
AS
description,
( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased * discount_percent / 100 )
+
( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased * discount_percent / 100 ) *
( Sum( CASE WHEN cumulative != 1 THEN percent ELSE 0 end) / 100 )
+ ( ( ( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased * discount_percent / 100 ) *
( Sum(CASE
WHEN cumulative != 1 THEN percent
ELSE 0
end)
/
100 ) + ( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased *
discount_percent / 100 ) ) * (
Sum(
CASE
WHEN cumulative = 1 THEN percent
ELSE 0
end) ) / 100 ) AS total,
( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased * discount_percent / 100 ) * ( Sum(
CASE
WHEN cumulative != 1 THEN percent
ELSE 0
end) / 100 ) + ( ( ( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased
*
discount_percent
/ 100 ) * ( Sum(
CASE
WHEN cumulative != 1 THEN percent
ELSE 0
end) / 100 ) + (
item_kit_unit_price * quantity_purchased
-
item_kit_unit_price *
quantity_purchased
* discount_percent / 100 ) ) *
(
Sum(CASE
WHEN cumulative = 1 THEN percent
ELSE 0
end) ) / 100 ) AS tax,
( item_kit_unit_price * quantity_purchased -
item_kit_unit_price * quantity_purchased * discount_percent / 100 ) - (
item_kit_cost_price * quantity_purchased ) AS profit
FROM phppos_sales_item_kits
INNER JOIN phppos_sales
ON phppos_sales_item_kits.sale_id = phppos_sales.sale_id
INNER JOIN phppos_item_kits
ON phppos_sales_item_kits.item_kit_id =
phppos_item_kits.item_kit_id
LEFT OUTER JOIN phppos_sales_item_kits_taxes
ON phppos_sales_item_kits.sale_id =
phppos_sales_item_kits_taxes.sale_id
AND phppos_sales_item_kits.item_kit_id =
phppos_sales_item_kits_taxes.item_kit_id
AND phppos_sales_item_kits.line =
phppos_sales_item_kits_taxes.line
WHERE sale_time BETWEEN "2014-04-01 00:00:00" AND "2014-04-30 23:59:59"
AND phppos_sales.location_id = '1'
AND phppos_sales.store_account_payment = 0
GROUP BY sale_id,
item_kit_id,
line)
ORDER BY sale_id,
line;
最佳答案
当您将 SELECT
与写入语句(例如 INSERT INTO...
或 CREATE TABLE AS...
结合使用时,则 MySQL必须在 SELECT
中涉及的表上建立共享锁。
您有另一个并发事务 (2) 对表 phppos_sales
持有独占锁,因此事务 (1) 无法获得其 S 锁,并且事务 (1) 等待。
然后事务 (2) 请求对故事 phppos_sales_items_taxes
进行 X 锁定。但是事务 (1) 已经在队列中以获得对该表的 S 锁,事务 (2) 必须在队列中等待它。
因此事务 (2) 正在等待事务 (1),而事务 (1) 正在等待事务 (2)。这是一个典型的僵局。
这只每隔几天发生一次,因为它取决于事务 (2) 在事务 (1) 开始其 SELECT
之前获取其对 phppos_sales
的第一个锁定。然后事务 (2) 尝试在事务 (1) 的 S 锁请求排队后获取它在 phppos_sales_items_taxes
上的第二个锁。
换句话说,这是一个竞争条件,而且很难重现。
如果事务 (2) 请求锁定它需要的所有表作为一个原子操作,那么事务 (1) 将无法在锁定请求之间潜入。
您可以通过显式使用 LOCK TABLES
实现此目的:
START TRANSACTION
LOCK TABLES phppos_sales WRITE, phppos_sales_items WRITE,
phppos_sales_items_taxes WRITE, ...other table(s)...
INSERT INTO phppos_sales
INSERT MANY RECORDS INTO phppos_sales_items
INSERT MANY RECORDS INTO phppos_sales_items_taxes
INSERT MANY RECORDS INTO phppos_sales_payments
UNLOCK TABLES;
COMMIT;
这确实意味着执行长时间运行的 SELECT
的事务 (1) 必须等待事务 (2) 完成其 INSERT
并解锁其表。
否则,如果 SELECT
先进行,则意味着事务 (2) 必须等待它完成。
如果避免使用 CREATE TABLE...SELECT
或 INSERT INTO...SELECT
,则可以在没有锁争用的情况下填充临时表。也就是说,将 SELECT
的结果集取回您的应用程序,然后将这些行INSERT
到临时表中。这样 SELECT
就不需要任何 S 锁。
您可以在存储过程中使用游标来做同样的事情。
正如@BrendanF 评论的那样,您还可以将事务隔离级别更改为 READ-COMMITTED,而不是默认的 REPEATABLE-READ。您可以全局更改默认事务隔离级别,也可以逐个 session 更改隔离级别。这会稍微改变交易的语义,因此您应该了解这些差异。
但它确实消除了在插入/选择操作期间从表中读取时 SELECT
执行 S 锁的需要。
关于php - mysql CREATE临时表+事务导致死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23768456/
目前我正在构建相当大的网络系统,我需要强大的 SQL 数据库解决方案。我选择 Mysql 而不是 Postgres,因为一些任务需要只读(MyISAM 引擎)而其他任务需要大量写入(InnoDB)。
我在 mysql 中使用如下命令。当它显示表格数据时,它被格式化为一个非常干净的表格,间距均匀且 |作为列分隔符。 SELECT * FROM TABLE_NAME; 当我从 CLI 运行命令时,如下
我知道这个问题之前已经被问过好几次了,我已经解决了很多问题,但到目前为止没有任何效果。 MySQL 试图将自身安装到的目录 (usr/local/mysql) 肯定有问题。关于我的错误的奇怪之处在于我
以下是我的 SQL 数据结构,我正在尝试如下两个查询: Select Wrk_ID, Wrk_LastName, Skill_Desc from Worker, Skill where
我们有一个本地 mysql 服务器(不在公共(public)域上),并希望将该服务器复制到我们拥有的 google 云 sql 实例。我的问题是:1.这可能吗?2.我们的本地服务器只能在本地网络上访问
我有一个表(test_table),其中一些字段值(例如字段 A、B 和 C)是从外部应用程序插入的,还有一个字段(字段 D),我想从现有表(store_table)插入其值,但在插入前者(A、B 和
我想创建一个 AWS RDS 实例,然后使用 terraform 管理数据库用户。因此,首先,我创建了一个 RDS 实例,然后使用创建的 RDS 实例初始化 mysql 提供程序,以进一步将其用于用户
当用户在我的网站上注册时,他们会在我的一个数据库中创建自己的表格。该表存储用户发布的所有帖子。我还想做的是也为他们生成自己的 MySql 用户——该用户仅有权从他们的表中读取、写入和删除。 创建它应该
我有一个关于 ColdFusion 和 Mysql 的问题。我有两个表:PRODUCT 和 PRODUCT_CAT。我想列出包含一些标记为:IS_EXTRANET=1 的特殊产品的类别。所以我写了这个
我想获取 recipes_id 列的值,以获取包含 ingredient_id 的 2,17 和 26 条目的值。 假设 ingredient_id 2 丢失则不获取记录。 我已经尝试过 IN 运算符
在 Ubuntu 中,我通常安装两者,但 MySQL 的客户端和服务器之间有什么区别。 作为奖励,当一个新语句提到它需要 MySQL 5.x 时,它是指客户端、服务器还是两者兼而有之。例如这个链接ht
我重新访问了我的数据库并注意到我有一些 INT 类型的主键。 这还不够独特,所以我想我会有一个指导。 我来自微软 sql 背景,在 ssms 中你可以 选择类型为“uniqeidentifier”并自
我的系统上有 MySQL,我正在尝试确定它是 Oracle MySQL 还是 MySQL。 Oracle MySQL 有区别吗: http://www.oracle.com/us/products/m
我是在生产 MySQL 中运行的应用程序的新维护者。之前的维护者已经离开,留下的文档很少,而且联系不上了。 我面临的问题是执行以下请求大约需要 10 秒: SELECT COUNT(*) FROM `
我有两个位于不同机器上的 MySQL 数据库。我想自动将数据从一台服务器传输到另一台服务器。比方说,我希望每天早上 4:00 进行数据传输。 可以吗?是否有任何 MySQL 内置功能可以让我们做到这一
有什么方法可以使用 jdbc 查询位于 mysql 根目录之外的目录中的 mysql 表,还是必须将它们移动到 mysql 根目录内的数据库文件夹中?我在 Google 上搜索时没有找到任何东西。 最
我在 mysql 数据库中有两个表。成员和 ClassNumbers。两个表都有一个付费年份字段,都有一个代码字段。我想用代码数字表中的值更新成员表中的付费年份,其中成员中的代码与 ClassNumb
情况:我有 2 台服务器,其中一台当前托管一个实时 WordPress 站点,我希望能够将该站点转移到另一台服务器,以防第一台服务器出现故障。传输源文件很容易;传输数据库是我需要弄清楚如何做的。两台服
Phpmyadmin 有一个功能是“复制数据库到”..有没有mysql查询来写这个函数?类似于将 db A 复制到新的 db B。 最佳答案 首先创建复制数据库: CREATE DATABASE du
我有一个使用 mySQL 作为后端的库存软件。我已经在我的计算机上对其进行了测试,并且运行良好。 当我在计算机上安装我的软件时,我必须执行以下步骤: 安装 mySQL 服务器 将用户名指定为“root
我是一名优秀的程序员,十分优秀!