Exporting a MySQL database through PHPMyAdmin - mysql

I'm hoping to export a database that I only have access to through phpMyAdmin so that I can make a copy of it on my localhost. I've never done this before and the database is fairly large at 200 tables. Does anyone have experience doing this? I'm just unsure if the web interface of phpMyAdmin is a reliable way to export that much data or if I'd be causing some performance issues by attempting to export the data.
Thanks for any advice. Thy phpMyAdmin version is 2.1 if that helps any.

In the table, select Export, tick the "Save as file" option, and keep the selection as "Compression: None".
You will be able to download huge data tables like this.

The issue you will come against is the max_execution_time setting.
What i have found is large databases take longer to dump than what is set here (defaults to 30 seconds).
This will cause your export to fail.
Also make sure you are not trying to dump to the browser, I have found that option unreliable. Choose the save to a file option, and download the dump via ftp .
But as Col. Shrapnel said, try it first!

Related

Database inaccessible when Exporting

I am exporting a MySQL database that is currently in use by an application, but when I start the process the database becomes inaccessible and the application does not work, so I had to terminate the export process to allow the application to use it again. As the application is live, I cant let it go offline. Is this a normal thing, that MySQL database doesn't work when being exported, or do I need to do something in particular to export it this way?
Are you using mysqldump? Sounds like your tables are being locked.
Are you working with InnoDB tables? If you are using mysqldump, I'd look into the --single-transaction option. That will take a snapshot, but the key thing to remember is that any data changed during the export will not be reflected in the output. It will be in the production db, just not in the export until next time.
https://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_single-transaction

MYSQL Database offline use

Is there a way to use a MYSQL database without the database management system.. Like use tables offline without installing the db management system on the machine..
If there is can you please point me in the right direction?
Thank you!
As far as I know, there is no way to do this.
However, there is a portable DBMS SQLIte. It comes in different ways and can be used on other platform with different programming languages.
After reading your comment, I'm almost sure, this is what you need.
It's not that fast as MySQL I guess, but it works.
You can use The embedded MySQL Server Library to access MySQL data files without running the MySQL server.
You can setup a database to work on your localhost. This will be offline unless you setup the front-end stuff to let the internet interact with it.
What exactly do you mean "without the database management system"? You always need a way of interacting with it, even if it is offline. (Otherwise how can it work for you?)
The server side piece of the application, mysql-server, is needed at a minumum to run mysql. This server application comes with all the tools built-in to manage the instance. I doubt you can prevent installation of this.
If you've actually opened the table files in a hex or text editor, you'll see that you will definitely need the mysql application installed to make any sense of them to use them. Sure the records are all there in plain text (.myd files for myisam, the ibdata1 file for innodb tables), but it would be a complete time-waster devising a custom app to parse or update the file structure, as well as trying to tie in table structure contained in the related files for each table.

MySQL database manipulation program for Windows? Like MS Access or MS SQL?

Is there any program (preferably official) for Windows that can be used to manipulate MySQL data dumps?
For example, easily importing a MySQL text dump and create the database for all kinds of manipulations (you know, common data operations such as select, update, insert, delete, export into CSV, etc.) via a GUI interface. Much like what you can do with MS Excel and MS Access.
I know only phpMyAdmin which requires a local web server environment which might a little too much for what I need.
I thought http://dev.mysql.com/downloads/mysql/ was what I needed and installed to find out that it's not.
Any such tools exist? I ask this is actually because these MySQL dumps are for my users who know nothing about SQL or anything technical. This is for them, not me. After they downloaded the SQL I provided, they ask me: "How can I open it?"
I tried to provide them CSV, but CSV generated by this approach: http://www.kavoir.com/2010/11/mysql-export-table-to-csv-text-files-for-excel.html would contain stuff like \" if the original data contains ". When you open the CSV in Excel, \" are all over the place.
http://www.webyog.com/en/
I used to use SQLyog at my last job. It's a pretty decent GUI tool for interacting with MySQL, either local or remote. It'll cost you $99 at the cheapest, but you can try it for 30 days. If you like it and it makes life easier, it could be worth the $99, as well.
Running a local server is actually pretty easy. I use xampp which was really easy to install and came set up and ready to use phpMyAdmin. It's also really easy to shut the whole server (or just parts of it) down when it's not in use to conserve system resources.

Restore deleted database

I just deleted two days of work because I though I had a backup, but I didn't. Now I need to create the database from scratch and I just wonder, isn't there a built-in backup system, just in case of someone being stupid? It's running on localhost and I haven't exported it out before.
If you've had binary logging enabled, then you might be lucky enough to use it to restore your database.
Note: If you ask me 'how do I know if I had binary logging enabled?' this pretty much means you didn't, because it's disabled by default.
There are several options. They're covered in detail at http://dev.mysql.com/doc/refman/5.1/en/backup-and-recovery.html
If you are developing some kind of app, I'd also recommend to store your DB structure in your version control system together with your source code.
No.
Computers will do anything you command them to - but it is your responsibility to know what you're doing.
In this way, "if you wanted backups, you would have made them" - power-user tools (such as databases) are optimized for performance, not for being user-proof.
Install the MySQL Workbench:-
On left side panel (i.e. under the Administration section), you will find the option to "Data Import/Restore".
On click, you will land on the Data Import. Select the option "Import from Dump Project Folder" and then select the file based on TimeStamp of that duration when the database was deleted.
Click on "Load Folder Content"
Select database object to import, check whether the deleted database is visible or not.
If visible then select all the tables and click on start import button.
If not visible then start with step 2 again and one by one select all the dump files.
At least I was able to recover all my database which accidentally got deleted during the database restore (i.e. initialization process).
This has saved my weeks of effort.

if we only have access to phpMyAdmin what's the best way to backup the entire db?

For someone that is not used to mySQL, when using phpMyAdmin administration program, what is the recommended setup to backup the entire database with all tables and with data?
Most of those options are fine, but check the Structure -> "Add DROP TABLE..." and "Add CREATE PROCEDURE", then Data -> "Extended inserts" (this decreases loading time when re-inserting the data and isn't essential). Then click "Save as file" and export, the rest of the options are suitable.
I'm assuming that your database is large and you're having problems with phpMyAdmin timing out. If that's the case, and you don't have shell access, then you may have to write a PHP script, which executes a mysqldump command, and then call it asynchronously so there is no browser timeout issue. It would be a sloppy workaround, but if the access is limited, something like that may be your only option.
Although it has it's places, phpmyadmin's strong suit is not database backups.
Having said that, if your database is small, using the default settings via an .sql export should be fine.
If your database is large (i.e. more than a couple MB) and/or you care about it, backups should be done on the server level via logical copy, or by doing a mysqldump.