How do I migrate a SQLAnywhere 9 db running in a remote server into a mysql server on my machine? - mysql

I am working at a company that has some CRM software running in a remote Windows XP server that uses a SQLAnywhere 9 db to store its data; I have access to this remote server with an administrator account.
I would like to extract the db into a .sql file so that I can run the db locally on my machine without affecting the running db in the server (since it is key for the company's day to day operation).
The reason I need this is that we are going to test some BI Software and we need data from this database to test it, but we don't know the structure of the database since the developers of the CRM software didn't give us any documentation on it. So we need to have the database locally so that, without affecting the running CRM, we can:
understand the structure by looking at the DDL
make queries to it to get sample data
I researched a bit, and the most common solution to my problem was to use dbunload on the remote server to unload the db into a reload.sql file that contained what I needed. But most tutorials on the subject mention that I have to stop the db first (which would be catastrophic). If this is the only option, then I guess I am willing to do it on the weekend when the CRM is not used, but I wanted to know if there was another solution first.
If there is no other solution, can you point me to where I can find the proper and safer way to do this?
I have researched a lot, but prior to this day I have never even heard of SQLAnywhere, so I really need all the help I can get. My main concern is doing something that impacts negatively the CRM software.
Thank you.

You can run dbunload across the network, you just have to tell it to do an "external" unload. The default is to do an internal unload which would only work from the machine where the database server is running.
I don't have SQL Anywhere 9 documentation right now to look up the exact switch, but dbunload -? should show you all the possible switches.
Edit:
-an will create a new database and load the data and schema from another data
-xi switch will do external unload and internal reload.
-c parameters to connect to your remote database

Related

Database during release and developing

I am new to Database programming and there is some general questions that I would like to ask. I created the schema in my localhost using mySQL and linked to eclipse. There are some problems that I do not know how to approach.
One of my friends would like to help to develop at his personal machine, but he could not link to my database server. So one way is to copy the schema to his mySQL and change the connection string, are there any better ways?
If I would to release the project and run it on different machines, will it affect the databases operation since the schema resides in my local server.
Is there ways to just like attach the database inside the project since it is a local database and I am not accessing it from any other programs.
Sorry if my questions sound very stupid. I am really new.
Your approach of running local test MySQL instance for every developer sounds fine.
However, if your application never needs any data shared (essentially database is always local as you stated), then you should ask yourself if MySQL really an appropriate solution for your application. I think SQLite is a better choice in that situation - it is likely to work faster than MySQL for local access, and it has essentially zero setup - no database daemon to run or anything like that which greatly simplifies application install.
Granted, SQLite has its limits, but I often use SQLite for my projects, and only if they grow large, I might migrate them to MySQL or PostgreSQL if task requires it.
Typical signs that SQLite may not cut it:
Many clients (10+) need to access database for writing
Total database size is very large - more than 10GB total

multiple machine MySQL through Workbench

I have recently started using MySQL Workbench, hence I apologise if this is not the proper platform to ask this question. I tried to figure out the solution of my own, but could not find any appropriate one.
Here is my situation: At my workplace, we have a huge set of data about the operational and financial figures such as sales, employee, profit, etc for European companies spread over past 7-8 years and new data keeps coming regularly. However, the problem is we work from different remote locations, me in one city and the other two colleagues in a different city. Normally, we share our work files (.xls/.doc) etc through Dropbox. So, we thought of creating a database in MySQL wherein we all can submit/edit/add this data so that we can filter and analyse this data on several ways once the collection is complete. And we plan to use and access it thereafter. We believe that this is ease a lot of our work. So all I want to know is: can all three of us collaborate simultaeousy (in order to add or edit the data) through workbench Server administration, like the way we collaborate our work through Dropbox? I want to be the host (like the administrator) and then want to allow the access to my colleagues.
Thank you for your time and answer. You may also refer me to any site or link to read more about it.
I think you are a bit confused about what MySQL Workbench is.
MySQL workbench is just a data viewer and administration tool that connects to a MySQL server, there's no data "stored" in MySQL workbench, all the data is stored in the server.
MySQL workbench can:
Connect to a MySQL server
Send SQL instructions and show the results: You can create and drop databases, send SQL queries, create and execute stored procedures and functions... all assuming you have the right privileges.
Perform administration tasks: You can create and drop users, grant or revoke permissions, etcétera
But the fact is: all is stored in a MySQL server... so the answer to your question is: Yes, you can work simmultaneously with your colleagues, if and only if all of you can connect to the same database server (as Mike W commented).
Addressing your comments, and clarifying more details:
MySQL is a database server. When you install it in a computer, all data is stored in that computer (aside from replication and other fine details). You should make regular backups of your data (MySQL has tools for that, one is mysqldump). If you want to access the data stored in your database server, you can do it:
By ussing the command-line client,
By using MySQL workbench or another GUI client program, or
By any program that can connect to the database server (via ODBC or specific libraries).
Focusing on MySQL Workbench, and addressing your specific question: If your machine breaks down, you can install the MySQL Server in any other machine, and load the backup into it. You will have to configure that new machine so that any of your coworkers can connect to it (that may imply that a new set of connection parameters is created).

Can I run my own instance of MySQL?

I'm trying to migrate a web site to friend's server. The site uses MySQL, but he didn't previously have it set up. He's installed the package now and suggested that I could run my own instance of it. I'm at a loss for how to do so. Is it even possible? If so, how?
Some relevant information:
The OS in use is CentOS 5.9
Using MySQL 5.0.95
I only need the DB to be read locally via PHP when serving my site.
I have no root privileges on this system (although a full shell), but am close friends with the owner/administrator if that's necessary.
To clarify:
It's the daemon that I want to run my own instance of. So I guess what I want to know is if it's possible to have multiple users on the system running their own instances of mysqld containing different databases.
All I need this for is serving a web page. If I have to break down and switch to a pseudo-database using CSV files I will, but I'd much rather stick to MySQL if I can.
If MYSQL is setup on that machine yes you can run your own instance of it.
You can have it set up and your site given its on Database within that MYSQL instance and that specific MYSQL account can be used to access the tables etc. involved with your website.
Now if he is only putting MYSQL on the machine then having you set everything up you will just need an account for MYSQL and from ther eyou can get in and just create all the needed items that will allow your site to fully function.
EDIT
In response to your comment. You can you just can't clog the same port or have configurations that conflict each other. As long as it won't be to much of a performance hit and you configure a different user to start each instance you should be able to do Something like this.

mysql: keeping local mysql database and remote server database synced up

I am kind of a amateur at web development. But it seems like most people develop on their local machines and the upload to their remote servers when everything is ready. I want to start doing this. I've installed Xampp (Apache) on my local machine. But in order for this to really work, i need the the mysql databases that already exist on my remote server to be "synched" or "duplicated" on my local machine. But I'm finding this somewhat hard to figure out.
First, Should I be using mysql "reduplication" feature (with my remote server as master) and local machine as slave? Or is there a better way to do this? Should I be synchronizing instead of reduplicating
Second, Is anyone willing to give me a quick description of how I achieve this "reduplication" or "synchronization"
Thanks
It may be tempting, but it's hopeless to try to keep the database in two places. Instead, always keep the database on the server because it's much easier to develop and debug your code if it's in just one place. "Resynch" and "reduplicate" and all that business is just too much trouble, as you are discovering. The DB is going to end up on the server anyway, so you may as well put it there right now.
Also, you will not need a web server on your local machine, which will unburden you.
This next is applicable if you are writing CGI. If you aren't sure whether or not you are writing CGI, then you are not (well, probably not). {
If you mainain just one database and it lives on your server, you'll be able to write one piece of portable code that will run equally well on your local machine and on your server. This is a huge win, take my word for it.
To get this working, you will need the mysql library on your local machine; no other mysql component is needed there. The mysql server will run on your server only.
Read up on mysql "connector" for the language you're using.
}

Remote backup of MySQL database

Our Java server application logs data to a SQL database, which may or may not be on the same machine. Currently we use MS SQL Server, and we're now porting to MySQL. A user configures database backup parameters on our app server, e.g. time of day to run a backup, and the app server executes SQL Server's BACKUP DATABASE command at the appropriate time, via a sproc. It does incremental backups daily and full backups weekly.
MySQL lacks an equivalent feature to tell the database from a client connection to back itself up. Options we're considering are:
Create a UDF to shell out to mysqldump (or copy database files), which can be called from our app server via a sproc. Essentially we'd be implementing a version of BACKUP DATABASE for MySQL.
Create a service to run on the MySQL box that can get the backup settings from the app server and run mysqldump (or file copy) locally.
Create a backup sproc to mimic mysqldump, e.g. SHOW CREATE TABLES and SELECT INTO OUTFILE for each table.
Setting up a cron job, Perl script, third-party app or other tricks that'd work great in a data center aren't preferred; this is a shrink-wrap package that needs to be pretty robust and hands off.
Database sizes can range from roughly 10MB to 10GB.
I'm aware of the binary logs for the incremental piece. I figure the general solution will probably apply to them as well, if we decide to use them.
This is all on Windows 2003 32-bit or 2008R2 64-bit, MySQL 5.1.
The UDF option seems the best to me. The UDF Repository (http://www.mysqludf.org/) has mysqludf_sys, which may be all we need, but I thought I'd ask for opinions since after extensive googling it doesn't seem like others have reached the same conclusion, or maybe our needs are just out of the ordinary. Our app is the only thing in MySQL, so I'm not worried about other users having access to our UDF.
Any solutions I'm overlooking? Any experience with using UDFs in such a way?
Thanks,
Eric
For this an other reasons we decided to collocate our application with the database, so this problem became moot.