如何从数据文件夹加载mysql数据库?

发布于 2024-10-30 03:19:46 字数 620 浏览 0 评论 0原文

我创建了一个 joomla 网站,并开始准备将其导出到远程主机 - 主要是在远程服务器上修复目录树。但是,当我准备使用 phpMyAdmin 导出数据库时,它不存在。我尝试在命令行中查询它,但收到“未知数据库”错误,就好像它不存在一样。数据库文件夹仍在/data中,因此没有被删除。我真的无法理解这一点,因为就在几分钟前,该网站正在运行,并且数据库已在 phpMyAdmin 中列出。 有没有办法让我重新导入数据库?我有数据库的文件夹,其中包含 .frm 文件,以及 db.out 文件。 我不得不说,这并不是我开始使用 MySQL 和 Joomla 以来遇到的第一个超自然问题。基本上每次我的电脑重新启动时,MySQL 服务都会拒绝我提供的密码 1-2 小时。我通过重置密码解决了这个问题,之后网站和数据库运行良好。 我使用 Windows 7 和 XAMPP 在本地主机上进行开发,MySQL 作为服务安装。 Joomla的版本是1.6。 提前致谢。

编辑 我尝试卸载 XAMPP 并完全删除其目录中的所有内容,然后再次安装并将数据库的文件夹复制到新的数据目录中。虽然我可以通过使用 mysql workbench 连接到 mysql 来查看数据库,但所有表都列为 0 KB 大小,如果我尝试打开表或尝试修复表,则会收到错误 1146(表不存在)数据库。这真是太荒谬了。

I created a joomla website and started preparing to export it to the remote host - mainly working on the remote server to fix the directory tree. However, when I prepared to export the database with phpMyAdmin, it is not there. I tried to query it in the command line and I get a "unknown database" error, as if it does not exist. The database folder is still in /data, so it was not deleted. I am really unable to comprehend this as just a few minutes prior to that, the website was working and the database was listed in phpMyAdmin.
Is there a way for me to import the database back in? I have the database's folder with the .frm files in it, as well as a db.out file.
I have to say that this is not the first paranormal issue that I have encountered since starting out with MySQL and Joomla. Basically every time my PC is restarted, the MySQL service denies the password I supply it with for 1-2 hours. I fixed this by resetting the password, and the website and database was running fine after that.
I am using Windows 7 with XAMPP for development on local host and MySQL is installed as a service. Joomla's version is 1.6.
Thanks in advance.

EDIT
I tried uninstalling XAMPP and completely erasing everything in its directory, then installing again and copying the database's folder into the new data directory. While I am able to see the database by connecting to mysql with mysql workbench, all the tables are listed as having 0 KB size and I get error 1146 (table does not exist) if I try to open a table or when I tried repairing the database. This is getting really ridiculous.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

七分※倦醒 2024-11-06 03:19:46

我设法修复了它;但仍不确定如何。
我全新安装了 XAMPP(之前我对 xampp/mysql/data 文件夹进行了完整备份),然后使用 MySql Workbench 连接到 mysql 服务器。我创建了一个与旧数据库同名的数据库。然后我将 /data/mydatabase 文件复制到新数据库的文件夹中。最后,我将 ibdata1 从旧的 /data 文件夹复制到新的文件夹中。
第一次这不起作用,因为我没有将 db.out 文件从旧的 /data/mydatabase 复制到新的。这些表将显示在 MySqlWorkbench 中,但任何对其执行任何操作(打开、查询或转储)的尝试都会导致错误 1146。
我能够制作一个 sql 转储文件,该文件上传到服务器上没有问题。

I managed to fix it; but still not sure how.
I made a clean installation of XAMPP (before that I made full backup of the xampp/mysql/data folder), then connected to the mysql server with MySql Workbench. I created a database with the same name as the old one. Then I copied the /data/mydatabase files in the new database's folder. Finally, I copied the ibdata1 from the old /data folder to the new one.
This did not work the first time because I had not copied the db.out file from the old /data/mydatabase to the new one. The tables would show in MySqlWorkbench, but any attempts to do anything on them (open, query, or dump) resulted in an error 1146.
I was able to make a sql dump file, which uploaded without a problem on the server.

十秒萌定你 2024-11-06 03:19:46

您的 XAMPP 有问题,您的安装有问题。该网站还能工作吗?如果是这样,我强烈建议安装 Akeeba Backup 并使用它来获取整个站点的备份。这将使移动整个站点变得容易,而不必手动移动任何东西。

You have an issue with XAMPP, there is something wrong with your installation. Does the site work at all? If it does, I would highly recommend installing Akeeba Backup and using that to get an entire site backup. This will make it easy to move the entire site without having to mess around with moving anything manually.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文