[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: SQL database - some questions



On Wed, Jun 28, 2017 at 02:25:55PM +0200, Hans wrote:
> sqlbrowser looked best promising, but my sql databases can't be opened with 
> it. I want to export the *.sql file into a new database, but I get stuck with 
> an error. Telling ???e "unknown statement: 1#, unrecogized token: 1"#"", so it 
> looks like a format error. 
> 
> Well, I do not know, what is causing that, as I said, I am not expierience in 
> databases.

Start by actually reading the compressed backup, using zless.  See whether
it looks like an SQL dump.  If it does, then you can proceed to the next
steps.

Install mariadb/mysql (whatever the server package is called, for your
release of Debian).  Do whatever it is you need to do in the database
admin account so that you can restore your database dump as your regular
user.

As your regular user, feed the compressed database dump to the "mysql"
(or its mariadb equivalent) command:

zcat yourfile.gz | mysql

You may have to supply a password, or some command line options to mysql,
or something like that.  Whatever you would normally do to restore a
mysql database dump.

If you get stuck, try googling "restore mysql database dump" or similar.
Yours is presumably compressed, due to the *.gz suffix on the file, so
you'll need to zcat it, instead of just feeding it directly to mysql.
That's pretty much it.


Reply to: