Recreate MySQL database in SQLite [duplicate] - mysql

This question already has answers here:
Export a MySQL Database to SQLite Database
(8 answers)
Closed 7 years ago.
I have a MySQL database that I would like in SQLite for an app I'm planning to develop. How would I go about this? Thanks.
I saw the previous question Export a MySQL Database to SQLite Database
However, there was no accepted or definitive solution. So what would be the best approach to doing this?
OK, my solution: (hope somebody finds this useful)
Installed DB Browser for SQLite from http://sqlitebrowser.org/
I exported the MySQL structure (without data) as SQL.
Then cleaned up the SQL according to this link
http://livecode.byu.edu/database/mysql-sqliteExport.php
Then in DB Browser for SQLite imported the cleaned up SQL to create the database and all the tables. I found that DB Browser for SQLite didn't allow importing of CSV data into the already created tables. So I went to the Apple App Store on my Mac and bought and installed SQLPro for SQLite app ($12 Australian...).
In SQLPro for SQLite I opened the SQLite database created in DB
Browser for SQLite.Then exported each MySQL table as CSV and
imported those into each existing table in SQLPro for SQLite.
Done

Although I've only used sqlite in an Android environment, I would recommend looking over the following:
Documentation and examples
Step-by-step example of usage
SQLite vs MySQL vs PostgreSQL
Keep in mind that sqlite is a stripped-down version of mysql and has a lot of features missing. For example, while altering an table you may only rename or add new columns, but you may not delete the existing columns. Have a look at the documentation for more specific details that may apply to your specific implementation.
You may find all the limitations here: Sqlite limitations

Related

SaaS application on shared server with multiple databases

I am going to create a SaaS application in PHP. In that application the user can create and manage multiple tables to extend functionality. After user finish with the application he can download php code and database.
We will also provide sql import functionality so the user can create schema from (.sql) file.
I search on google but not found any proper solution. You can consider sqlfiddle functionality here.
I have 2 options in my mind but need better solution:
1) For creating multiple database and its tables, use table prefix as a solution
2) Convert mysql to sqlite. At the time of download create export as mysql (.sql) file.
It can have aprox. 10,000 users/databases. Please suggest a solution to provide each user a seperate database if any.
If shared server will not work I will purchase VPS. The main requirement is to provide each user their own database.
I am going to choose sqlite as a choice for db. After doing some benchmark sqlite seems good option for DDL and DML operation.
I will use mysql to sqlite .sql converter: https://github.com/sutara79/convert-mysql-to-sqlite
To improve the speed I follow following stackoverflow post:
Improve INSERT-per-second performance of SQLite?

Configuring mysql database for psiturk experiment

I recently picked up a task at a lab I volunteer at and my PI said their experiment wasn't working because no workers were able to complete the task...
My hypothesis is that their sqlite implementation doesn't allow for proper recording of experimental data due to sqlite's ineffectiveness at concurrent operations (as stated in the psiturk documentation).
My question is, how can I properly set up a mysql database to work with their already made experiment?
I created a new database called "particpants" from the mysql interpreter. Then I started the mysql server successfully...
Next, I changed the database_url in the "config.txt" file from being equal to sqlite://participants.db (a local database file) to being equal to mysql://aweeeezy#localhost:3306/participants, but I can not connect to the database when I try to start the psiturk server.
I also tried mysql://aweeeezy#localhost/particpants...I can't figure out how to format this database_url string so that the experiment works with mysql, and I haven't found anything helpful when searching through mysql related posts and/or psiturk related posts.
Please help a databases noob!
The format for the database_url field of config.txt using MySQL needs to be mysql://username:password#hostname/database. psiTurk 2.0 depends on SQLAlchemy and some docs about that are here: http://docs.sqlalchemy.org/en/rel_1_0/core/engines.html

Is there a Database Dictionary feature in MySQL Workbench?

I have developed my ERD, which is great feature in MySQL Workbench, but what I am wondering is there a feature on the Mac version that will export a Database Dictionary? In a table or Excel format, which outlines all the tables the columns and the column table with any of the comments that have also been inputted?
Currently I am writing them out by hand - and would be great if there was a time saving way of doing this.
There is such a feature, called DbDoc, but it's only available in the commercial edition of MySQL Workbench available with a MySQL subscription.

Migrate data from oracle to mysql [duplicate]

This question already has answers here:
Migrate from Oracle to MySQL
(7 answers)
Closed 8 years ago.
We are doing data migration from oracle to mysql using etl tool where source and target are in different hosts.
During fail over of the source we are set to do data migration with dump export/import.
Is there any way to import oracle dump directly into MYSQL without third party tools?
If its possible please explain a feasible soultion
Oracle import/export is designed to move databases/data between Oracle databases ideally of the same version, so no - this isn't an appropriate solution. Depending on the size and complexity of your database you could do it with scripts - sqldeveloper/modeller (free oracle tools) should help with this if you don't know how to do it yourself. I think sqlmodeller may allow you to generate a schema for another database (you can do it for sqlserver). The main thing to overcome is syntax differences between oracle and mysql as well as differences in datatypes - if you have been consistent in your oracle db design it should be fairly easy to overcome these with find/replace
http://www.oracle.com/technetwork/developer-tools/datamodeler/overview/index.html?ssSourceSiteId=otnru

How can I explore mysql database files (*.frm, *.myd and *.myi) without MySQL?

The old versions of our product allowed to capture the current state of the system in a single archive file, which also contains the MySQL database files - lots of <XXX.frm, XXX.myd, XXX.myi> triples .
Now we have the next generation of the product, which does not do anything stupid like capturing the database files, but it must know to read the archives produced by the old versions.
Our product is a commercial closed source product, but it is not very expensive. We had to stop using MySQL, because of the second reason (Oracle has changed the MySQL licensing) and we cannot use MariaDB, because of the first one (their licensing freaked the s*t out of the company lawer).
So, my question is there another way to read these MySQL database files? A commercial light weight solution is fine - after all, we are talking about read-only exploration of the database files. Free/Open Source alternatives are welcome too, as long as they do not mean that the code using them must be Open Source too.
Thanks.
EDIT
Besides the issue whether I can or cannot continue using the old version of MySql to read the old MySql database files, the question remains how can I read them? I mean, MySql is no longer our database, so even if I can bundle with the old MySql implementation, do I have to install the full blown database engine to just read the files? I'd rather avoid that.
If you want to go thru tables structure it would be enough to read the following links.
MySQL internals (all), File Format, MyISAM
If it is not enough and you database size less then 10G you can use Ms SQL Server Express (which is free with DB less than 10G. Page to compare different versions of Ms SQL Server is here). Search for the way to convert MySQL files to Ms SQL Server. Here is the first link a got from Bing: link1 (I suppose not all of them need MySQL server)
If it is not suitable. You can try another MySQL forks like: XtraDB, OurDelta, Drizzle, PBX and so on.
Hope you will find something useful.
We have found a solution. Unfortunately, it involves MySQL, so there are potential licensing issues. Here it is - http://dev.mysql.com/doc/refman/5.0/en/libmysqld.html
All it takes is download the MySql source code and help yourself with:
libmysqld.dll
libmysqld.lib
header files from the include folder
Then it is possible to read the files using the embedded MySQL database engine inside libmysqld.dll.