Forums

Got error: 1356

Hello, when I use the backup command: <div class="codehilite"> <pre> <code class="language-python"> mysqldump -u myusername -h myusername.mysql.pythonanywhere-services.com --set-gtid-purged=OFF --no-tablespaces 'myusername$dbname' > db-backup.sql </code> </pre> </div>

I get this error: <div class="codehilite"> <pre> <code class="language-python"> mysqldump: Got error: 1356: View 'myusername$dbname.dimpor_bal' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them when using LOCK TABLES </code> </pre> </div>

I created the mentioned view as follows: <div class="codehilite"> <pre> <code class="language-python"> DROP TABLE IF EXISTS dimpor_bal; DROP VIEW IF EXISTS dimpor_bal; CREATE OR REPLACE VIEW dimpor_bal AS SELECT ballance.dimpor_id AS id, dimpor.fcn_c AS fcn_c, round(-(least(ballance.bal,0)),2) AS db, round(greatest(ballance.bal,0),2) AS cr FROM (((select collect_pay.id_dimpor AS dimpor_id,sum((coalesce(collect_pay.CRIDT,0) - coalesce(collect_pay.DBIT,0))) AS bal from collect_pay group by collect_pay.id_dimpor having (bal <> 0))) ballance join dimpor) WHERE (ballance.dimpor_id = dimpor.id) ; </code> </pre> </div>

Any suggestions would be appreciated

Best Regards

Try adding the --single-transaction argument to your mysqldump command