Can we have a sql express-like database using MySql - mysql

Can we create a sql express-like database using MySql.
meaning: the database files can reside in the project's directory and can work on any machine having sql express installed.
Does MySql provide such a facility? and if so, how can this be done
thanks

Nope. This is not possible.

I've used Firebird SQL for that kind databases, especially coupled with the embedded engine.

Take a look at libmysqld. Basically, it lets you embed a MySQL server in a C/C++ program. Not sure how it works, as i've never used it. But it's supposedly a standard part of MySQL now, so it could be available to anyone that has MySQL installed.
I imagine you could have your own folder of tables and such, point the embedded server at it, and go.

Related

Changing from SQL database server to hosting server's mySQL

I have made a web page which uses a local SQL database server.
Now that I want to publish the web page and place it online, I have to change everything, because the hosting server uses mySQL and presents me with his own mySQL database, and I don't know how to make that transition, I have an entity model in my solution and the Controller my database.
The specific question is - what are the steps to make that transition?
1 use SQL Tools (don't know what version you have) do a full backup.
2 from the new hosting server, restore the database.
3 change your connection strings or path (depends on programming environment) to use new MySQL.
Here is a link to what I used when I migrated in a similar way as to automate the whole process(Yes, it took a little learning but worth it). https://www.youtube.com/watch?v=rpPANKhbpDs
try to install mysql connector
https://dev.mysql.com/doc/connector-net/en/connector-net-entityframework60.html
MySQL Workbench provides you with the Migration Wizard feature. It allows you to migrate databases from various RDBMS products to MySQL.
This documentation would help you get started,... http://mysqlworkbench.org/2012/07/migrating-from-ms-sql-server-to-mysql-using-workbench-migration-wizard/
There are also several paid tools available which convert MS SQL to MySQL, but I've never used them personally. These tool come with free trial so you can actually test them before purchase. You can also refer similar threads on Stackoverflow,...
How to migrate SQL Server database to MySQL?
How to export SQL Server database to MySQL?

load yago files into MySql

I want to load the files of Yago database into my database in mysql. I tryed what is written in yago's website (to run the script Postgres.sql) but since I work on windows it does not recognize the "psql" operation. I tryed also to open the script directly in mysql but it says that there is sql syntax. What can I do? Thanks for helpers!
You are trying to load a Postgres SQL script into a mySQL database.
Postgres and mySQL speak different dialects of SQL and can't necessarily understand scripts meant for eachother.
If you want to load up a postgres SQL script, use a postgres database.
Installers for the windows version of postgres are available here:
https://www.postgresql.org/download/windows/
Once you have postgres installed, you can then use an admin tool e.g.
PGadmin (https://www.pgadmin.org/) to run the script on your DB and import the information within.
Feel free to comment if you want more detailed instructions.

Delvering a modified database from the local env to the production one

I'm working with MySQL databases.
To simplify the problem, let's say I have two environments : the local one (development) and the remote one (production mode).
In the database, I have some tables that contain configuration data.
How can I automate cleanly the delivery from the development mode to the production mode when I modify the database schema and the configuration tables content ?
For instance, I dot it manually by doing a diff between the local and remote databases. But, I find that method not so clean and I believe there is good practice allowing that.
This might be helpful in cases where you have multiple environments and multiple developers making schema changes very often and using php.. https://github.com/davejkiger/mysql-php-migrations
Introduce parameter "version" for your database. This version should be written somewhere in your code and somewhere in your database. Your code will work with database only if they have equal versions
Create a wrapper around your MySQL connection. This wrapper should check versions and if versions are not compatible, it should start upgrade.
"Upgrade" is a process of sequential applying the list of *.sql files with SQL commands, which will move your database from one state to another. It can be schema changes or data manipulation commands.
When you do something with database, do it only through adding new *.sql file and incrementing version.
As a result, when you deploy your database from development enviroment to production, your database will be upgraded automatically in the same way as it was upgraded during development.
I've seen LiquiBase http://www.liquibase.org/ a lot in Java environments.
In most of my projects I use sqlalchemy(a Python tool to manage db plus an ORM). If you have some experience(little more than beginner) with Python I highly recommend using it.
You can check this tool with a little help of that. This is also very useful for migrating your db to other rdbms(for example mysql to postgres or oracle).

I'm trying to migrate SQL SERVER Express to MySQL

I have a somewhat small database in SQL Server Express 2005 that I really need to migrate over to a MySQL install on my hosting service (Dreamhost). After reading for a couple days, everything pointed to the MySQL Migration Toolkit, which is unfortunately EOL. I was able to find an archive and install it on my server running Sql Server. I set the source database, and set my Dreamhost MySQL as the destination. For whatever reason I get tons of permission errors trying to migrate although the user I'm connecting to MySQL as full permissions (working with dreamhost on this).
Is there a better way to do this? I've heard that I should use some third party tools, (like dbtools) and then I heard NOT to use third party tools.
Like I said the database is small, with a few views, a few functions, and a few stored procs, which I can manually move over if needed.
What are my options? Thank you!
Export your SQL Server database to a downloadable package (SSIS?)
Install SQL Server Express locally.
Install MySQL locally.
Run the Migration Toolkit locally.
Dump the MySQL database
Upload and run the Dump file # DreamHost (via phpMyAdmin if possible).
For such a small database you may spend more time trying to get a 3rd party tool to work for your situation than it would take you to just move the stuff manually. If you used standard SQL and little to nothing proprietary to SQL Server, creating the objects manually in MySQL should be easy enough... you just have to be aware of the slight syntax differences between the two platforms. Once the structures are created, generating insert statements to populate the data should also be trivial.

Migration from SQL Server to MySQL

I need to migrate data from SQL Server 2000 to MySQL. Currently I am using MySQL workbench. Can any one tell how to do this?
If you are searching for a tool MySQL has a tool called "MySQL Migration Toolkit" that can be used to migrate the data from SQL to mysql. But the first thing as mentioned above is to do a backup. The next thing to check would be whether there are any datatypes that cannot be converted?
Exactly, what have you tried? You can quickly migrate data from MSSQL to MySQL if they are in any of the following data file formats:
Paradox (.db)
DBase (.dbf)
Delimited Text (.txt)
Excel (.xls)
XML (.xml)
MS Access Database (.mdb)
ODBC
If its a one-to-one, exact same database architecture on both the new and the old servers, you might want to try using database tools meant to make this an easier process for GUI based administrators. Just go to download.com and find some software that may assist you in that migration, Navicat is a good one. The most important thing is to always BACK IT UP! BACK IT UP! BACK IT UP! Never do anything without mirroring drives and doing whatever it takes to make sure if you don't destroy any data, but if you do you'll have backup copies of it. Also how fast your machines are will be a sizable factor when it comes to migrating very large databases.
All in all you have many options to choose from, yet the most important thing is to back it up! Can't stress that enough, yeah it might seem like meaningless extra work especially on humongous database systems, but trust me, its better to be safe than sorry. Also, I always like rebooting machines prior to making database changes to them, cutting off any connection to the outside world or any processes depending or updating its data. Turning off the ODBC will do much of that for you on Windows as well, but as always better safe than sorry. Many a corruption can be avoided by simply booting the machine and having all data in memory finalized on the active database, before backing it up or appending to it.
Check out etlalchemy. It is a free, open-sourced Python tool capable of migrating between any of the following SQL databases: PostgreSQL, MySQL, Oracle, SQL Server, and SQLite.
To install: pip install etlalchemy
To run:
from etlalchemy import ETLAlchemySource, ETLAlchemyTarget
# Migrate from SQL Server onto MySQL
src = ETLAlchemySource("mssql+pyodbc://user:passwd#DSN_NAME")
tgt = ETLAlchemyTarget("mysql://user:passwd#hostname/dbname",
drop_database=True)
tgt.addSource(src)
tgt.migrate()