Forum Archive

mysqldump failed with an error

DavinE

Hello Guys,

I have a Question is it possible to run the mysql dump on Pythonista ?

i try to use this code:

subprocess.Popen('mysqldump --user=username --password=passwd --databases mydb > test.sql')

but every time i tried i get this error:

Traceback (most recent call last):
  File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/UI/Test Ordner/MYSQL/mysqlRequest-CustomerEntries.py", line 139, in <module>
    mysql_data()
  File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/UI/Test Ordner/MYSQL/mysqlRequest-CustomerEntries.py", line 17, in __init__
    self.list_data()
  File "/private/var/mobile/Library/Mobile Documents/iCloud~com~omz-software~Pythonista3/Documents/UI/Test Ordner/MYSQL/mysqlRequest-CustomerEntries.py", line 136, in list_data
    subprocess.Popen('mysqldump --user= username --password= passwd --databases mydb > test.sql')
  File "/var/containers/Bundle/Application/2952696D-C724-455F-8983-F13D0477091A/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 708, in __init__
    restore_signals, start_new_session)
  File "/var/containers/Bundle/Application/2952696D-C724-455F-8983-F13D0477091A/Pythonista3.app/Frameworks/Py3Kit.framework/pylib/subprocess.py", line 1261, in _execute_child
    restore_signals, start_new_session, preexec_fn)
PermissionError: [Errno 1] Operation not permitted

or do i something wrong ?
Thanks for your reply!

cvp

@DavinE please read this topic about subprocess in Pythonista.

DavinE

@cvp, Thanks for this topic!
now i need to find another way :D

JonB

You may be able to run the string command that you were trying to Popen, using the commandline in stash.