Migrate big MySQL database respecting the AutoIncrement holes - mysql

I have a MySQL database 5.1.49 with 150+ tables on third party hosting provider. Most of the tables have AUTO_INCREMENT primary key and holes in the values.
When I try to generate a script for the database from phpMyAdmin it times out since the database is big.
When I try to migrate the database using MySql Workbench it fails with a Workbench bug.
Is there a tool that can migrate big MySQL databases while respecting disordered and having holes auto increment fields?

Related

Insert data from one MySQL to another MySQL instance

I have 2 servers running mysql and they have the same database/table, but with different entries. There was a reason for that, but now I need to merge these databases. I've made a dump of the whole database in server 1 and I want to insert these data into the database of server 2. The problem is: How do I insert this data just incrementing the database of server 2? I can't lose the data that already is on server 2.

migrate from MSQL to SQL with table relationship intact

I migrated the database successfully from MSQL to MYSQL using MySQL Workbench however it deleted the table relationships(foreign key). Is there a way if i can migrate the database including the table relationship..
I have over 350 tables in the database and its difficult to manually write the foreign key(if existed) for each table..

Migrate big tables from MySql to MsSql

I have a big database around 46GB in Mysql format and I managed to convert all the database to MSsql except two tables, the biggest ones. When I try to migrate those 2 tables, one by one , after a while I get the error message "The connection has been disabled"
I encreased the timeout from SSMA option from 15 to 1440 and decreased the bash from 1000 to 500 and same thing, The tables have 52 mil rows and 110 milion rows with 1,5 GB and 6.5 GB.
I tried incremential version but I don't have a unique id to use
What can I do to migrate them
Thank You
You should be able to use SQL Server Integration Services (SSIS). You can create a dataflow that pulls from MYSql and dumps the Data into MSSQL.
You'll need to create a Data flow task that includes an OLE Database Source and connect it to an OLE Database Destination.
I had the same problem using SSMA. I managed to migrate 100+ million rows of a table with 40+ columns.
I assume you've done the configuration well.
You need to ensure that there is no activity in the MSSQL database. No SELECTS over those tables and no any other activities.
Check out the two tables' structures to ensure they are fine. You can run the SSMA project only for those two tables.
Hope this helps.
I had the same issue and fixed by using the following configuration described here in detail: MySql 5.6 to MSSql server 2014 migration : ExecuteReader requires an open and available Connection
Also, I have documented the whole MySQL to MSSQL migration process here: Migrate Data and Schema from MySQL to SQL Server

Integrating Sphinx to MySQL

I am trying to use Sphinx full-text search capability for my MySQL server.
I have setup a local Sphinx service based on the installation manual and able to do text search.
I can connect to
mysql.exe --host=127.0.0.1 port=9306
Where the port 9306 is the port configured in sphinx.conf:
searchd {
...
listen = 9306:mysql41
...
}
And do SphinxQL queries. I am using the default Sphinx example database shipped with the release package.
However I want to integrate Sphinx with my MySQL server, such that all the clients connecting to my sql server can do SphinxQL and I want to try it out with the MySQL sample database sakila
What are the steps to achieve that?
Do I need to convert the database engine from InnoDB to Sphinx?
Also, from what it seems, Sphinx can only index one (1) database
table per configuration, how can I make sure that all tables in the
MySQL database gets indexed?
However I want to integrate Sphinx with my MySQL server, such that all the clients connecting to my sql server can do SphinxQL
Can't do that. Sphinx (when enabled for sphinxQL) just gives you a server that looks like a mysql one - ie it uses the same communications protocol - mainly so can just reuse mysql client libraries, rather than having to make a new one just for sphinx.
They are different 'servers'. You connect to a mysql server to run mysql commands; you connect to sphinx server to run sphinxQL commands.
The application woudl have to connect to each 'server' seperately. Just imagine sphinx was something like postgres, you clearly dont connect to mysql and expect to be able to run postgresql.
However there is SphinxSE - which is a fake mysql storage engine. You install it into mysql, and you can then create a table using this engine. Then you run mysql queries against this table, under the hood are contacts a running sphinx-server. So to mysql it looks like a table that contains data, this is most useful because can then 'join' this search table with the original data table to get results and the original data in one mysql query.
The application then doesn't have to connect to sphinx itself. SphinxSE does it for you.
http://sphinxsearch.com/docs/current.html#sphinxse
Do I need to convert the database engine from InnoDB to Sphinx?
No. You keep the original data where it is, using what ever engine you like. Sphinx just provides an 'index' - it doesnt store the original data*. Its not a database as such, just provides for fast quering with its highly optimized indexing.
Basically you ask sphinx for the unique id's of documents matching a certain query. Then use those ids to lookup the data. SphinxAPI, sphinxSE and sphinxQL are just three different mechanisms of doing that.
Also, from what it seems, Sphinx can only index one (1) database table per configuration,
No. A single sphinx instance can host many indexes. And an index can have many sources. So can just create one index per table. Or if you mainly want to search them together, can just create one amalgamated index.
--
** Edit to reply to question in comments: **
When you say that, sphinx can host many indexes, is it relying solely in the sphinx.conf configuration file?
You would probably define one sphinx index per table. So you would need a source/index pair for each table. (unless you wanted to index all tables in one index, whihch is possible too.
It cant read the tables itself, and create config file, you have to define each index individually.
When you say "gives you a server that looks like a mysql one" do you mean like a proxy,
No. Not a proxy.
where my MySQL client can connect to this Sphinx port and the client will think that its a MySQL server?
Basically yes. The client will connect to it the same way it connects to a mysql-server.
 If so, then I can execute both MySQL SQL queries and also SphinxQL at the same connection?
No. Impossible. Connect to mysql-server, to run mysql queries. Connect to searchd to run sphinxQL queries.
Two connections, one per server.
why my MySQL Workbench can't connect to port 9306,
Don't know. Might be a firewall issue.

My Sql Database Backup

HI All,
I have a MYSQL DATABASE ,I want to create backup of this database into another machine(secondary) ,and to link the machine with original database(primary)
Is there any way that if primary database fails then it pick from the secondary database.
EDIT:How is this possible in window OS
its called as clustering, check
http://www.mysql.com/products/cluster/