MySQL export/import data consistency problem - mysql

Currently experiencing an issue whereby I am exporting a MySQL structure and data from a server into a sql file, ready for importing into a local database.
When importing the sql file into a local database, numerous records are changing dramatically. The columns in question tend to be of type bit(1).
The local setup uses the following versions Apache 2.2.17, PHP 5.3.5 and MySQL 5.5.8.
The server is currently using MySQL 5.1.56.
Any ideas what can be done to rectify this scenario?

Try using the --hex-blob parameter with the mysqldump utility when obtaining the sql dump.

Related

How to Convert .sql of Mysql to postgresql

My Question is the following how to convert .sql
mysql to postgresql sql , so I can uploaded to postgresql database at heroku
and please let it be free tool.
many thanks
Here are two tools for migrating from MySQL, both are actively maintained:
1) pgloader https://github.com/dimitri/pgloader. With it, conversion is just a one line:
pgloader mysql://user#localhost/dbname_in_mysql postgresql:///dbname_in_postgres
2) pg_chameleon https://pypi.python.org/pypi/pg_chameleon – this one is actually a replication system so it's suitable for systems under load.

How to backup/restore a single database running with mysql 5.0 from one server to other available server?

I am currently using mysql server 5.0 with innodb storage engine. I want to backup a database from source server and restore the same to one of the available destination servers.
Option 1: Use innodb_file_per_table option in my .cnf and try to copy the table.ibd file to the other server and recover. I saw examples over other websites where it was being supported in mysql 5.6, but I am not sure if that is supported in mysql server 5.0. I tried the steps given in https://dev.mysql.com/doc/refman/5.6/en/innodb-migration.html, but that did not work for me.
Option 2: Use mysqldump to get a dump of the database and use mysqlimport in the destination to perform mysql export/import. But, by doing so, I need to lock the database at source before performing the export. This can prevent any incoming requests to the source database while the mysqldump is ongoing.
I am still exploring other options, but I am not sure if option 1 is not viable due to mysql version 5.0 or because I am missing something.
http://dev.mysql.com/doc/refman/5.7/en/replication-howto.html
You are talking about replication.

how to connect kognitio database from mysql

I need to select some data from WX2 Database and put it in MYSQL DB.
Can any one help me on this?
Is ODBC.ini configuration will work for the mysql database to connect to WX2 database?
Thanks
To access the data in Kognitio you could use the ODBC driver to retrieve it, or for better performance use the bulk unloader utilities to export it as CSV, which you could then load into MySQL.
If you were going the other way round, pulling data FROM MySQL TO Kognitio, you could bulk unload as CSV from MySQL then bulk load into Kognitio, or you could use the External Table functionality of version 8 to access MySQL tables on demand from Kognitio via an ODBC connector.
The documentation covers off all these approaches.

Can we generate mysql database in perl without connecting to server?

Recently i came across a tool written in tcl which generates a mysql database without connecting to a server. It uses some c libraries, can this be done in perl? Sorry if this is too basic question. This is completely new to me, couldnt find much information.
EDIT:
By "generates a mysql database" i mean it generates a directory with mysql tables. I can create a soft link to that directory in mysql and query data from that
You can generate an SQL file maually that builds up a database when imported into a mysql database. I would advise against manyually creating binary tables and copying them under mysql's data folder.
On the other hand if you want to use SQL databases locally, without having to run a separate server process try SQLite.

Import MySQL MyISAM into SQL Server

Caveat: I have zero experience with MySQL.
I've been given a series of files to do a data conversion and would like to migrate the provided data into SQL Server 2008. The files are:
*.myd
*.myi
*.frm
These file types, as I understand it, are MyISAM. I believe that if I had a running MySQL instance, migrating to SQL Server would be fairly straightforward. I could could either use SQL Server's import wizard or Microsoft SQL Server Migration Assistant for MySQL v1.0. Unfortunately, these files are what I'm stuck with -- I just don't have access to the original MySQL instance.
I also don't presently have MySQL as a running instance locally and I'm not sure if there would be compatibility issues with the files I have.
Can I attach them to MySQL 5.5 with the goal of performing a SQLDump or perhaps to use either tool mentioned above? Am I missing a better way?
Yes, you can easily attach them to MySQL 5.5. Then you can dump the tables using mysqldump (be aware that you will need to either modify dump and remove mysql-specific stuff from the dump, or probably customize mysqldump output - check mysqldump documentation for details). You can also try to link Mysql instance to SQL Server, and then copy tables using SELECT ... INTO [sql_server_table_name] FROM [mysql_table_name].
In any case, the hardest part is to migrate stored procedures/triggers. Mysql and SQL Server have quite a different syntax for them, so you probably cannot automate this process.
Update
Also, I forgot to mention that you will have to modify mysql auto_increment columns to IDENTITY([next_auto_increment_value],1) SQL server.