首页 \ 问答 \ Mediawiki数据库恢复(Mediawiki database recovery)

Mediawiki数据库恢复(Mediawiki database recovery)

我有一个小的维基,我曾在一个免费的主机上托管,但它似乎被垃圾邮件,主机把它取下来了。 他们传给我一个2GB大的.sql文件。 我正在寻找另一个wiki,将.sql加载到其中并清理混乱(或找到好东西并将其复制出来)。

我建立了一个新的mediawiki,然后我做了以下事情:

mysql -u <user> -h mysql.domain.com -p<password> -e "drop database <dbname>;"
mysql -u <user> -h mysql.domain.com -p<password> -e "create database <dbname>;"
mysql -u <user> -h mysql.domain.com -p<password> <dbname> < file.sql

这需要很长时间,但我没有错误,然后当我访问mediawiki网址时,我看到:

A database query error has occurred. This may indicate a bug in the software.

这是错误的方法吗? 我能正确完成这项工作的最简单方法是什么?


编辑:

现在看到:

A database query error has occurred. This may indicate a bug in the software.

Query:
SELECT page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len,page_content_model FROM `page` WHERE page_namespace = '0' AND page_title = 'Main_Page' LIMIT 1
Function: WikiPage::pageData
Error: 1054 Unknown column 'page_content_model' in 'field list' (mysql.domain.com)

I had a small wiki I had hosted on a free host, but it seems it got spammed and the host took it down. They passed me a .sql file which was 2GB large. I am looking to set up another wiki, load the .sql into it and clean up the mess (or find the good stuff and copy it out).

I set up a new mediawiki, then I did the following:

mysql -u <user> -h mysql.domain.com -p<password> -e "drop database <dbname>;"
mysql -u <user> -h mysql.domain.com -p<password> -e "create database <dbname>;"
mysql -u <user> -h mysql.domain.com -p<password> <dbname> < file.sql

It takes a long time but I get no errors, then when I visit the mediawiki url I see:

A database query error has occurred. This may indicate a bug in the software.

Is this the wrong way to do this? What is the easiest way I can do this correctly?


Edit:

Now seeing:

A database query error has occurred. This may indicate a bug in the software.

Query:
SELECT page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_latest,page_len,page_content_model FROM `page` WHERE page_namespace = '0' AND page_title = 'Main_Page' LIMIT 1
Function: WikiPage::pageData
Error: 1054 Unknown column 'page_content_model' in 'field list' (mysql.domain.com)

原文:https://stackoverflow.com/questions/26831047
更新时间:2023-08-08 17:08

最满意答案

SPSS有一个FILE HANDLECD命令(正如你所指出的那样)有助于尝试使这些类型的事情更容易。

但是我选择了一种不同的方法,我可以使用我的所有工作设置,如果你使用Python也可以实现。

您可以使用python获取(保存的)语法文件的动态位置,如下所示:

os.path.dirname(SpssClient.GetDesignatedSyntaxDoc().GetDocumentPath()) 

我已经在过去发布了一个详细的解决方案,您可以在这里找到它,也可能在您的方案中找到帮助。


SPSS has a FILE HANDLE and CD command (as you point out also) that aid to try make these type of thing easier.

However I opt for a different approach that I have all my job setup to use, which if you use Python can implement also.

You can get the dynamic location of a (saved) syntax file using python like so:

os.path.dirname(SpssClient.GetDesignatedSyntaxDoc().GetDocumentPath()) 

I have posted a detailed solution to this in the past which you can find here and may find helpful in your scenario also.

相关问答

更多
  • 如何学习spss[2022-08-03]

    电子工业出版社出版的《PASW/SPSS Statistics中文版统计分析教程(第3版)(含CD光盘1张)》一书不错
  • 如何安装spss[2022-11-02]

    SPSS的安装步骤: 1、启动Windows,在程序管理器中选“文件”菜单的“运行”项,弹出“运行”对话框,点击“浏览...”钮,根据安装盘所在的驱动器(A:或B:或光盘)及其路径,找到SPSSINST.EXE文件,点击“确定”钮返回“运行”对话框,再点击“确定”钮,即运行安装程序。 2、安装程序运行后,出现安装选项对话框(如图1.1所示)。用户可根据自己的需要选择欲安装的模块:即在所需的模块名前“¨”内点击,使“¨”内出现“ý”表明选中;若再点击使“ý”转为“¨”表明取消选择。选择完毕后点击OK钮。 3、 ...
  • SPSS GETURI DATA提供SPSS GETURI DATA扩展,允许您从在线打开sav,excel,sas或Stata数据集。 否则,您无法直接执行此操作,但可以使用HOST命令设置下载文件的提示,然后将其打开。 像下面的东西(安装wget后我的Windows机器): HOST = ['cd "your drive here"','wget http://www.yoururl.com/yourfile.sav']. 然后你应该能够使用普通的SPSS语法打开文件。 There is an ext ...
  • 您可以定义一个目录路径,并在其他文件句柄声明中使用它来保存类型,而不是相对路径: FILE HANDLE directoryPath / NAME ='C:\ Directory \ Path \'。 FILE HANDLE myFile /NAME='directoryPath/fileName.xyz'。 GET FILE ='myFile'。 这将得到文件:C:\ Directory \ Path \ fileName.xyz。 斜线的方向可能很重要。 (适用于17版本) Instead of a r ...
  • 您可以使用python获取SPSS语法的相对路径(假设已保存)。 SpssClient.GetDesignatedSyntaxDoc().GetDocumentPath() 然后,您可以使用pythons的os模块(或其他方式)导航到您想要的任何文件夹。 下面是检索语法的已保存文件位置以及接下来的两个级别的示例。 它还返回一个宏,其中包含存储为字符串的相关文件夹路径,以便稍后可以在SPSS命令(例如GET,INCLUDE等)中使用它们。 * Run this in any saved SPSS synta ...
  • 我将这两个文件保存在文件夹C:\ProgramData\IBM\SPSS\Statistics\24\extensions MYSET_CWD.py def Run(args): import spss, spssaux, SpssClient, os SpssClient.StartClient() my_filepath_ = os.path.dirname(SpssClient.GetDesignatedSyntaxDoc().GetDocumentPath()) m ...
  • merthsoft对以下stackoverflow发布的回答为获得spss并运行提供了一个很好的起点。 在C#中使用64位SPSS库 我个人拥有的挂断包括所有适当的dll,如... spssio64.dll icudt32.dll icuin32.dll icuuc32.dll 导出数据时,所有列都必须是唯一的。 如果您遵循与merthsoft类似的模式,创建案例的可能解决方案可能是包装并公开此方法...... [DllImport(“spssio64.dll”,EntryPoint =“spssCommi ...
  • 我找到了答案。 因此,类似于.SBS脚本中的VBA如何工作,Python可以直接从SPSS使用库来显示文件输入对话框。 BEGIN PROGRAM. from Tkinter import Tk from tkFileDialog import askopenfilename Tk().withdraw() filename = askopenfilename() print(filename) END PROGRAM. I found the answer. So similarly to how t ...
  • SPSS有一个FILE HANDLE和CD命令(正如你所指出的那样)有助于尝试使这些类型的事情更容易。 但是我选择了一种不同的方法,我可以使用我的所有工作设置,如果你使用Python也可以实现。 您可以使用python获取(保存的)语法文件的动态位置,如下所示: os.path.dirname(SpssClient.GetDesignatedSyntaxDoc().GetDocumentPath()) 我已经在过去发布了一个详细的解决方案,您可以在这里找到它,也可能在您的方案中找到帮助。 SPSS ha ...

相关文章

更多

最新问答

更多
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)
  • 是否可以嵌套hazelcast IMaps?(Is it possible to nest hazelcast IMaps? And whick side effects can I expect? Is it a good Idea anyway?)
  • UIViewAnimationOptionRepeat在两个动画之间暂停(UIViewAnimationOptionRepeat pausing in between two animations)
  • 在x-kendo-template中使用Razor查询(Using Razor query within x-kendo-template)
  • 在BeautifulSoup中替换文本而不转义(Replace text without escaping in BeautifulSoup)
  • 如何在存根或模拟不存在的方法时配置Rspec以引发错误?(How can I configure Rspec to raise error when stubbing or mocking non-existing methods?)
  • asp用javascript(asp with javascript)
  • “%()s”在sql查询中的含义是什么?(What does “%()s” means in sql query?)
  • 如何为其编辑的内容提供自定义UITableViewCell上下文?(How to give a custom UITableViewCell context of what it is editing?)
  • c ++十进制到二进制,然后使用操作,然后回到十进制(c++ Decimal to binary, then use operation, then back to decimal)
  • 以编程方式创建视频?(Create videos programmatically?)
  • 无法在BeautifulSoup中正确解析数据(Unable to parse data correctly in BeautifulSoup)
  • webform和mvc的区别 知乎
  • 如何使用wadl2java生成REST服务模板,其中POST / PUT方法具有参数?(How do you generate REST service template with wadl2java where POST/PUT methods have parameters?)
  • 我无法理解我的travis构建有什么问题(I am having trouble understanding what is wrong with my travis build)
  • iOS9 Scope Bar出现在Search Bar后面或旁边(iOS9 Scope Bar appears either behind or beside Search Bar)
  • 为什么开机慢上面还显示;Inetrnet,Explorer
  • 有关调用远程WCF服务的超时问题(Timeout Question about Invoking a Remote WCF Service)