How to migrate sqlite to mysql

Source: Internet
Author: User
Tags sqlite manager


1. SQLite export can be exported using a variety of tools. I use the SQLite Manager Management plug-in of FireFox. Use the SQLite Manager plug-in to open the database (. db. sqlite3) file and select export. Export the entire library file as a. SQL query statement. 2. Modify SQL statement compatibility
To ensure compatibility with SQL statements, you need to change the SQLite-specific format to the MySQL format. The general rules summarized below (the square brackets below should be ignored): www.2cto.com can change ["] to ['] or remove all ["], however, if some function names are used as Field Names (e.g. regexp), you will encounter errors. Note that some default values are ["], which does not apply to fields, should not be replaced but should be retained to remove all [begin transaction] [COMMIT] and any (whole) containing [sqlite_sequence) change all [autoincrement] to [auto_increment], change all ['F'] to ['0'], and change all ['T'] to ['1'] or ['false '. '] changed to ['0'] and ['true'] to ['1'] text field. unipue cannot be set, change to varchar (255). Note that sqlite does not differentiate data types. Therefore, some integer and text fields must be modified in combination with mysql. The field type set to CURRENT_TIMESTAMP by default must be TIMESTAMP. Save the modified file. 3. MySQL can be imported with a handy tool. Author: memorybox

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.