Langsung ke konten utama

Postingan

Menampilkan postingan dari Februari, 2019

export mysql to csv with command line

First, I can give you the answer for ONE table: The trouble with all these INTO OUTFILE or --tab=tmpfile (and -T/path/to/directory) answers is that it requires running mysqldump on the same server as the MySQL server, and having those access rights. My solution was simply to use mysql (NOT mysqldump) with the -B parameter, inline the SELECT statement with -e, then massage the ASCII output with sed, and wind up with CSV including a header field row: Example: mysql -B -u root -p dbname -e "SELECT * FROM query;" | sed "s/'/\'/;s/\t/\",\"/g;s/^/\"/;s/$/\"/;s/\n//g" > test.csv output: "id","login","password","folder","email" "8","mariana","xxxxxxxxxx","mariana","" "3","squaredesign","xxxxxxxxxxxxxxxxx","squaredesign","mkobylecki@squaredesign.com" "4","miedziak",

[sshtunnel.py:notify_exception_error:233]: Traceback (most recent call last) | Use module Crypto.Signature.pkcs1_15 instead

Recently I started getting the following error in a script that never had any problems in the past: NotImplementedError: Use module Crypto.Signature.pkcs1_15 instead There wasn’t much information related to this error in regards to Paramiko. Eventually I was able to “fix” it by running: sudo -H pip uninstall paramiko sudo -H pip uninstall pycrypto sudo -H pip install paramiko done