How to create mysql dump with Java on Linux system? -
i have make backups of mysql database in application.
i run command in windows , works nice. command:
string executecmd = mysqldumppath +" -u " + dbusername + " -p" + dbpassword + " --add-drop-database -b " + dbname + " -r " + filepath; runtime.getruntime().exec(executecmd); when try command on linux server, need put sudo password. how pass password in command line?
i had read many solutions no success.
either run java program root (with sudo) or pass sudo password via stdin sudo (very insecure, practically no secure way implement this).
Comments
Post a Comment