如何使用PHP将mysql转换为sqlite3 [英] How to convert mysql to sqlite3 using PHP

查看:184
本文介绍了如何使用PHP将mysql转换为sqlite3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在mysql服务器上有一个数据库.我想使用shell或perl脚本将其地转换为sqlite3数据库.我需要一些使用PHP转换相同内容的帮助.任何帮助,将不胜感激.

I have a database on mysql server. I want to convert that to sqlite3 database without using shell or perl scripts. I want some help converting the same using PHP. Any Help would be appreciated.

推荐答案

仅使用PHP会很麻烦,您必须从mysql表中获取所有记录,在sqlite3中创建适当的表并插入记录.

Using PHP only would be rather troublesome, you'd have to get all the records from your mysql table, create the appropriate tables in sqlite3 and insert the records.

据我所知,您只是想自动使用它,所以我看不到使用Shell程序的危害.您可以使用exec函数很容易地做到这一点: http://nl3. php.net/manual/en/function.exec.php

As far as I can tell you just want to to it automatically, so I would'nt see the harm in using shell programs. You could quite easily do this using the exec function: http://nl3.php.net/manual/en/function.exec.php

这篇关于如何使用PHP将mysql转换为sqlite3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆