Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

convert sqlite file into mysql

I have a .sqlite file which I want to convert into mysql. So is there any way to convert it into mysql?I am using ubuntu. So is there any shell script to change it. Any help will be highly appreciable.

like image 620
NewUser Avatar asked Nov 26 '22 20:11

NewUser


1 Answers

  1. assuming your sqlite db file is login.db
  2. download this script as sqlite3-to-mysql.sh
  3. this command will tranform your sqlite db file to standard mysql sql file: sqlite3 login.db .dump > sqlite.sql && bash sqlite3-to-mysql.sh sqlite.sql > mysql.sql && rm sqlite.sql
  4. import to mysql: mysql -uuser -ppassword -D database < mysql.sql
like image 133
xialu Avatar answered Nov 29 '22 10:11

xialu