mysql, blobs und shell

TOP5: Diverses, Verschiedenes, ...

  • Homepage
  • Über mich
  • Fotos
  • Musik
  • Kontakt

Feb 6: mysql, blobs und shell

Für ein Projekt muss ich eine MySQL Datenbank von der Shell aus betanken. Ich könnte natürlich den Umweg über PHP gehen, aber ich hatte eigentlich vor, PHP ausschließlich für die Webseitenelemente des Projekts zu nutzen.

Das ist ja an sich auch kein Problem, da es ein CLI Werkzeug gibt. Einzig, dass ich unstrukturierte Daten "von außen" einbauen muss, bereitete mir etwas Kopfzerbrechen.

Die Lösung war dann aber doch einfach genug:

printf "x'"; od -An -tx1 -v $1 |tr -d ' \t\n'; printf "'"

Wobei $1 der Name der Datei ist, die abgelegt werden soll.

Posted by Patrick Georgi in Hacks, Software Comments: (0) Trackbacks: (0)

Trackbacks
Trackback specific URI for this entry

No Trackbacks

Comments
Display comments as (Linear | Threaded)

No comments


Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Standard emoticons like :-) and ;-) are converted to images.
 
 

Statische Seiten

 

Layout by Andreas Viklund | Serendipity template by Carl