Hello,
Date: Tue, 15 Oct 2019 07:28:54 +0000 From: name name
To: "boost-users@lists.boost.org" Subject: [Boost-users] Help needed with boost::process::child and mysql cli Message-ID: Content-Type: text/plain; charset="windows-1252"
Hi,
Im use boost::process::child to create a mysql cli child process to import sql file. Normally im use this command: /usr/bin/mysql mysql -h127.0.0.1 -utestuser --password='!@#QWE123qwe' -P3306 --default-character-set=utf8mb4 --max-allowed-packet=1GB < /root/create_db.sql It?s worked well in bash.
But when use boost::process::child, std_err report ERROR 1045 (28000): Access denied for user 'testuser'@'localhost' (using password: YES). Is there any bugs in my code? [...]
I have no experience with boost::process, only one idea: Maybe the apostrophs around the password are normally eaten by the Linux shell, and you have to leave them out when building your arguments? // connection info args.push_back("-h127.0.0.1"); args.push_back("-utestuser"); args.push_back("--password=!@#QWE123qwe"); // <= args.push_back("-P3306"); Freundliche Grüße * Best regards * Met vriendelijke groeten * Meilleures salutations Holger Gerth _________________________________________________________________________________ EB-Soft Gesellschaft fuer elektronische Beschriftungs-Software mbH Neckargartacher Str. 114, 74080 Heilbronn, Germany Tel: +49 (0)7131 / 9466-0 Email: info@ebsoft.de Fax: +49 (0)7131 / 1099-0 Homepage: www.ebsoft.de Amtsgericht-Registergericht-Stuttgart HRB 102882 Geschaeftsfuehrer: Michael Ehring, Helmut Sigler _________________________________________________________________________________