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

Re: OT: SQL database - some questions



On Wed, 28 Jun 2017 15:12:26 +0200
Hans <hans.ullrich@loop.de> wrote:

> Hi Greg, 
> huuuuuu, that looks quite difficult for me. 
> > 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.
> >   
> Ho dso I do this? I unzipped my *.sql.gz and have now *.sql file. How
> can I see, if it is a sql-dump? What is this?
> 

Any program which can handle text should be able to see the content, if
it was not encrypted when the backup was made. Here is a fragment of
one of my old .sql dump files:

-- Dumping structure for table service1.tbl_units
DROP TABLE IF EXISTS `tbl_units`;
CREATE TABLE IF NOT EXISTS `tbl_units` (
  `UnitID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `Model` varchar(20) NOT NULL,
  `Serial` varchar(10) NOT NULL,
  `Firmware` varchar(10) DEFAULT NULL,
  PRIMARY KEY (`UnitID`),
  UNIQUE KEY `Serial` (`Serial`)
) ENGINE=InnoDB AUTO_INCREMENT=312 DEFAULT CHARSET=utf8
COMMENT='Construction history';

-- Dumping data for table service1.tbl_units: ~311 rows (approximately)
DELETE FROM `tbl_units`;
/*!40000 ALTER TABLE `tbl_units` DISABLE KEYS */;
INSERT INTO `tbl_units` (`UnitID`, `Model`, `Serial`, `Firmware`) VALUES
	(1, 'ILC-1', '0001', 'V1.23'),
	(2, 'ILC-1', '0002', 'V1.23'),
	(3, 'ILC-1', '0003', 'V1.23'),
	(4, 'ILC-1', '0004', 'V1.23'),
	(5, 'ILC-1', '0005', 'V1.23'),
	(6, 'ILC-1', '0006', 'V1.23'),
	(7, 'ILC-1', '0007', 'V1.23'),
	(8, 'ILC-1', '0008', 'V1.23'),

As you can see, the actual table data is in a highly structured form,
and could almost certainly be imported somewhere as CSV. I realise that
some of the data in fields of your database will be quite large.

The only issue I can see is one of size, if there is a very large
number of fields in each record of the table you need, or if a field is
too large for a cell in a CSV application such as LibreOffice Calc, or
if there are too many records.

-- 
Joe


Reply to: