gpt4 book ai didi

mysql - 导入大型数据库时的问题静态分析

转载 作者:行者123 更新时间:2023-11-29 16:13:46 31 4
gpt4 key购买 nike

我在导入大型数据库时遇到问题。我在本地 wamp64 上的 PHPMyAdmin 上创建了一个数据库,然后使用该数据库安装了 GLPI。现在一切都正常了,我想将其导入公司的服务器上,在那里我将使用我的数据库而不是当前的数据库来设置 GLPI。但是,当我访问公司的 PhPMyAdmin 时,我遇到了问题,我尝试导入数据库,但出现一个错误,告诉我“””,因此我尝试压缩文件,使其不那么重,或者创建行 $cfg['UploadDir'] ='upload'; 但是当我这样做时出现此错误:

错误

静态分析:

分析过程中发现 1 个错误。

Unrecognized keyword. (near "ON" at position 25)

SQL查询:修改修改修改

SET FOREIGN_KEY_CHECKS = ON;

MySQL replied: Documentation

2006 - MySQL server has gone away

Warning in .\libraries\dbi\DBIMysqli.class.php#261 mysqli_query(): MySQL server has gone away

回溯

.\libraries\dbi\DBIMysqli.class.php#261: mysqli_query( object, string INSERT INTO glpi_crontasklogs (id, crontasks_id, crontasklogs_id, date, state, elapsed, volume, content) VALUES (1, 9, 0, \'2019-03-01 15:39:08', 0, 0, 0, 0, 0, \'Run mode: CLI\'), (2, 9, 1, \'2019-03-01 15:39:08\', 1, 0.0755451, 0, \'Collect mails from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (3, 9, 1, \'2019-03-01 15:39:08\', 1, 0.645032, 0, \'Number of messages: available=0, retrieved=0, refused=0, errors=0, blacklisted=0\n\n\'), (4, 9, 1, \'2019-03-01 15:39:08\', 2, 1.23802, 0, \'Action completed, no processing required\'), (7, 9, 0, 0, \'2019-03-01 15:40:18\', 0, 0, 0, 0, \'Run mode: CLI\'), (8, 9, 7, \'2019-03-01 15:40:18\', 1, 0.0849578, 0, \'Mail collection from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (9, 9, 7, \'2019-03-01 15:40:18\', 1, 1.17437, 0, \'Number of messages: available=0, retrieved=0, refused=0, errors=0, blacklisted=0\n\'), (10, 9, 7, \'2019-03-01 15:40:18\', 2, 1.45225, 0, \'Action completed, no processing required\'), (11, 29, 0, \'2019-03-01 15:40:18\', 0, 0, 0, 0, \'Run mode: CLI\'), (12, 29, 11, \'2019-03-01 15:40:18\', 2, 0.126937, 0, \'Action completed, no processing required\'), (15, 9, 0, 0, \'2019-03-01 15:41:07\', 0, 0, 0, 0, \'Run mode: CLI\'), (16, 9, 15, \'2019-03-01 15:41:07\', 1, 0.0819528, 0, \'Collect mails from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (17, 9, 15, \'2019-03-01 15:41:07\', 1, 0.995655, 0, \'Number of messages: available=0, retrieved=0, refused=0, errors=0, blacklisted=0\n\n\'), (18, 9, 15, \'2019-03-01 15:41:07\', 2, 1.05668, 0, \'Action completed, no processing required\'), (21, 9, 0, 0, \'2019-03-01 15:42:17\', 0, 0, 0, 0, \'Run mode: CLI\'), (22, 9, 21, \'2019-03-01 15:42:17\', 1, 0.0884838, 0, \'Collect mails from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (23, 9, 21, \'2019-03-01 15:42:17\', 1, 1.15658, 0, \'Number of messages: available=0, retrieved=0, refused=0, errors=0, blacklisted=0\n\n\'), (24, 9, 21, \'2019-03-01 15:42:17\', 2, 1.20123, 0, \'Action completed, no processing required\'), (25, 17, 0, 0, \'2019-03-01 15:42:17\', 0, 0, 0, 0, \'Run mode: CLI\'), (26, 17, 25, \'2019-03-01 15:42:17\', 2, 0.102944, 0, \'Action completed, no processing required\'), (31, 9, 0, 0, \'2019-03-01 15:43:05\', 0, 0, 0, 0, \'Run mode: CLI\'), (32, 9, 31, \'2019-03-01 15:43:05\', 1, 0.0800591, 0, \'Collect mails from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (33, 9, 31, \'2019-03-01 15:43:05\', 1, 1.04019, 0, \'Number of messages: available=0, retrieved=0, rejected=0, errors=0, blacklisted=0\n\n\'), (34, 9, 31, \'2019-03-01 15:43:05\', 2, 1.05323, 0, \'Action completed, no processing required\'), (35, 23, 0, 0, \'2019-03-01 15:43:05\', 0, 0, 0, 0, \'Run mode: CLI\'), (36, 23, 35, \'2019-03-01 15:43:05\', 2, 0.117135, 0, \'Action completed, no processing required'), (39, 9, 0, 0, \'2019-03-01 15:44:16\', 0, 0, 0, 0, \'Run mode: CLI\'), (40, 9, 39, \'2019-03-01 15:44:16\', 1, 0.0911481, 0, \'Collect emails from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (41, 9, 39, \'2019-03-01 15:44:16\', 1, 1.14253, 0, \'Number of messages: available=0, retrieved=0, refused=0, errors=0, blacklisted=0\n\n\'), (42, 9, 39, \'2019-03-01 15:44:16\', 2, 1.18234, 0, \'Action completed, no processing required\'), (45, 9, 0, 0, \'2019-03-01 15:45:03\', 0, 0, 0, 0, \'Run mode: CLI\'), (46, 9, 45, \'2019-03-01 15:45:03\', 1, 0.053148, 0, \'Collect mails from assistance@carpediem.pro ({outlook.office365.com:995/pop/ssl})\n\n\'), (47, 9, 45, \'2019-03-01 15:45:45:03\', 1, 0.933414, 0, \'Number of messages: available=0, retrieved=0, refused=0, errors=0, blacklisted=0\n\n\'), (48, 9, 45, \'2019-03-01 15:45:03\', 2, 0.941932, 0, \'Action completed, no processing required\'), (49, 29, 0, \'2019-03-01 15:45:03\', 0, 0, 0, 0, \'Run mod.....

.\libraries\plugins\import\ImportSql.class.php#161: PMA_importRunQuery( string 'DROP TABLE IF EXISTS glpi_crontasks', string 'DROP TABLE IF EXISTS glpi_crontasks', boolean false, array, ) .\import.php#641: ImportSql->doImport(array)

你能帮我吗,因为我不知道问题出在哪里,也不知道如何解决

最佳答案

使用 phpmyadmin 导出和导入大型数据库可能不是最理想的。使用mysqldump命令进行备份并使用mysql进行恢复。网上有很多例子。只是一个良好的开端:

备份

mysqldump --add-drop-table --complete-insert --extended-insert --quote-names --host=localhost --user=root --password=YOURPASSWORD glpi > c:\glpibackup\glpi_mysqldump.sql

恢复

mysql -u root -p YOURPASSWORD < c:\glpibackup\glpi_mysqldump.sql

关于mysql - 导入大型数据库时的问题静态分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55018506/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com