Page 1 of 1

SQL tools

Posted: Tue Aug 28, 2012 6:56 am
by spaceman
I am so going to break everything. :mrgreen:

I'm looking for a tool(s) to open my SQL backups (for example: localhost.sql, the default name for the backup of my whole, live SQL database). Once 'open' I'd like to be able to export tables to .sql (or other) for importing back to the live database at a later stage. I'm looking for an 'offline' tool like phpmyadmin, so I can query, view and edit sql backups.

I have a feeling I don't know what I'm asking, but that's cool. Ideally, I would open localhost.sql in a text editor and cut and paste the bits I needed, but the damn SQL files won't open in gedit! :lol: Next time I will backup to csv files. Then I can poke around in the code.

Many thanks.

Re: SQL tools

Posted: Tue Aug 28, 2012 9:31 am
by spaceman
LOL it's far from ideal but I can open this mother of a file in Kate. :mrgreen:

Of course it had to wrap two very long lines which will break the file if I try to save it, but this is (a small) start. Other advice on appropriate tools/editors most welcome.

Re: SQL tools

Posted: Tue Aug 28, 2012 1:36 pm
by bigfoot65
If you use a Windows Client, Notepad ++ is a good editor.

Re: SQL tools

Posted: Thu Aug 30, 2012 4:14 am
by spaceman
Cheers, Bigfoot (I wonder if I can run Notepad++ in Wine?)

I did succeed in opening the files and editting them in nano, sadly saving them broke them. I suspect that had something to do with two lines having more than 1024 characters. This is going to be fun. Ta. ;)

Re: SQL tools

Posted: Thu Aug 30, 2012 5:09 am
by bigfoot65
It may run in wine, not sure. I would imagine there is an editor for Linux that could handle large files. Might try searching the internet.

Re: SQL tools

Posted: Fri Sep 07, 2012 10:35 am
by spaceman
Thanks BigFoot, Notepad++ worked a treat. It also run, reasonably well, through Wine.

SQL files are actually straight-forward in layout, so I can recommend that people open them up and manipulate them directly with a good text editor. MAKE BACKUPS FIRST. :mrgreen:

Cheers!

I wrote a wordpress sql databse hacking guide here. Would it be any use in the wiki?

Re: SQL tools

Posted: Fri Sep 07, 2012 11:03 am
by bigfoot65
Sure, you can make it a generic guide using WordPress as the example.