diff options
author | Sylvain <syt@logilab.fr> | 2008-03-12 10:41:43 +0100 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2008-03-12 10:41:43 +0100 |
commit | 12edcbdda5cfc0f2feb2d3a256e507755ea6f2ae (patch) | |
tree | eba1ead042a666667b7bc6bb7cdbf2d001945f1c /adbh.py | |
parent | 55997cb14b54f7a4ac3cbe131b704405d69c76ee (diff) | |
download | logilab-common-12edcbdda5cfc0f2feb2d3a256e507755ea6f2ae.tar.gz |
add -p option to mysql commands to ask for password
Diffstat (limited to 'adbh.py')
-rw-r--r-- | adbh.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -438,19 +438,19 @@ class _MyAdvFuncHelper(_GenericAdvFuncHelper): keepownership=True): """return a command to backup the given database""" # XXX compress - return 'mysqldump -h %s -u %s -r %s %s' % (dbhost, dbuser, backupfile, dbname) + return 'mysqldump -h %s -u %s -p -r %s %s' % (dbhost, dbuser, backupfile, dbname) def restore_commands(self, dbname, dbhost, dbuser, backupfile, encoding='utf-8', keepownership=True, drop=True): """return a list of commands to restore a backup the given database""" cmds = [] if drop: - cmd = 'echo "DROP DATABASE %s;" | mysql -h %s -u %s' % (dbname, dbhost, dbuser) + cmd = 'echo "DROP DATABASE %s;" | mysql -h %s -u %s -p' % (dbname, dbhost, dbuser) cmds.append(cmd) - cmd = 'echo "%s;" | mysql -h %s -u %s' % (self.sql_create_database(dbname, encoding), + cmd = 'echo "%s;" | mysql -h %s -u %s -p' % (self.sql_create_database(dbname, encoding), dbhost, dbuser) cmds.append(cmd) - cmd = pgdbcmd('mysql -h %s -u %s < %s' % (dbname, dbhost, dbuser, backupfile)) + cmd = pgdbcmd('mysql -h %s -u %s -p < %s' % (dbname, dbhost, dbuser, backupfile)) cmds.append(cmd) return cmds |