无法成功导出并重新导入 MySql 5 中的视图
当我在开发 PC 上导出数据库以在我的 Web 主机上导入时,它包含以下行:
--
-- Table structure for table `vi_sr_videntity_0`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `starrise`.`vi_sr_videntity_0` AS select `starrise`.`t_sr_u_identityfingerprint`.`c_r_Identity` AS `c_r_Identity`,`v_sr_videntityfingerprint`.`ID` AS `ID`,`v_sr_videntityfingerprint`.`FingerPrintID` AS `FingerPrintID`,`v_sr_videntityfingerprint`.`FingerPrintFingerPrint` AS `FingerPrintFingerPrint` from (`starrise`.`v_sr_videntityfingerprint` join `starrise`.`t_sr_u_identityfingerprint` on((`starrise`.`t_sr_u_identityfingerprint`.`c_id` = `v_sr_videntityfingerprint`.`ID`)));
大概因为它显示“root”@“localhost”,所以我的托管服务器不会接受导入。我被困住了,我不知道该怎么办。请帮助我知道如何正确地将此数据库传输到我的服务器。
When I export a database on my development PC, for import on my webhost, it contains the following line:
--
-- Table structure for table `vi_sr_videntity_0`
--
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY INVOKER VIEW `starrise`.`vi_sr_videntity_0` AS select `starrise`.`t_sr_u_identityfingerprint`.`c_r_Identity` AS `c_r_Identity`,`v_sr_videntityfingerprint`.`ID` AS `ID`,`v_sr_videntityfingerprint`.`FingerPrintID` AS `FingerPrintID`,`v_sr_videntityfingerprint`.`FingerPrintFingerPrint` AS `FingerPrintFingerPrint` from (`starrise`.`v_sr_videntityfingerprint` join `starrise`.`t_sr_u_identityfingerprint` on((`starrise`.`t_sr_u_identityfingerprint`.`c_id` = `v_sr_videntityfingerprint`.`ID`)));
Presumably because it says 'root'@'localhost', my hosted server won't accept the import. I'm stuck and I don't know what to do. Please help me know how to correctly transfer this database to my server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通常,当您将数据导入网络托管服务器时,您需要将数据保存为sql格式。尝试使用 phpwebadmin 将数据导出为 sql 格式并将其放入托管服务器的数据库根目录中。
*假设您购买了mysql数据库服务。
确保代码中的连接类映射到 Web 上数据库服务器的位置。
祝你好运!
usually when you import the data in a web hosting server, you need to save your data to a sql format. Try to use phpwebadmin to export the data to a sql format and drop it into the database root in the hosted server.
*Assuming that you bought the mysql database service.
Make sure that your connection class in your codes is mapped to the location of the database server on the web.
Good luck!
不知道为什么,但是当您从 phpmyadmin 导出时,它会添加很多在大多数情况下不需要的额外数据。例如,您可以删除多余的垃圾,如下所示:
No idea why but when you export from phpmyadmin it add a lot of extra data that in most cases is not required. For example you can remove the extra crap so that it is like this: