执行SQL是报错,如何解决

问题描述

[2020/05/28 14:32:36.709 +08:00] [INFO] [version.go:50] [“Welcome to Drainer”] [“Release Version”=v3.0.12] [“Git Commit Hash”=e4f2ba252977385faa32a0553808cc564d22929a] [“Build TS”=“2020-03-16 12:36:21”] [“Go Version”=go1.13] [“Go OS/Arch”=linux/amd64] [2020/05/28 14:32:36.709 +08:00] [INFO] [main.go:46] [“start drainer…”] [config="{“log-level”:“info”,“node-id”:"",“addr”:“http://192.168.15.122:8249”,“advertise-addr”:“http://192.168.15.122:8249”,“data-dir”:"/home/tidb/deploy/data.drainer",“detect-interval”:10,“pd-urls”:“http://192.168.15.115:2379,http://192.168.15.118:2379,http://192.168.15.120:2379”,“log-file”:"/home/tidb/deploy/log/drainer.log",“initial-commit-ts”:416956333467107331,“sycner”:{“sql-mode”:null,“ignore-txn-commit-ts”:[],“ignore-schemas”:“INFORMATION_SCHEMA,PERFORMANCE_SCHEMA,mysql”,“ignore-table”:null,“txn-batch”:20,“loopback-control”:false,“sync-ddl”:true,“channel-id”:0,“worker-count”:16,“to”:{“host”:“127.0.0.1”,“user”:“root”,“password”:"",“encrypted_password”:"",“sync-mode”:0,“port”:3306,“checkpoint”:{“type”:"",“schema”:"",“host”:"",“user”:"",“password”:"",“encrypted_password”:"",“port”:0},“dir”:"",“zookeeper-addrs”:"",“kafka-addrs”:"",“kafka-version”:"",“kafka-max-messages”:0,“kafka-client-id”:"",“topic-name”:""},“replicate-do-table”:null,“replicate-do-db”:null,“db-type”:“mysql”,“disable-dispatch”:false,“relay”:{“log-dir”:"",“max-file-size”:10485760},“safe-mode”:false,“disable-detect”:false},“security”:{“ssl-ca”:"",“ssl-cert”:"",“ssl-key”:""},“synced-check-time”:5,“compressor”:"",“EtcdTimeout”:5000000000,“MetricsAddr”:"",“MetricsInterval”:15}"] [2020/05/28 14:32:36.710 +08:00] [INFO] [client.go:144] ["[pd] create pd client with endpoints"] [pd-address="[http://192.168.15.115:2379,http://192.168.15.118:2379,http://192.168.15.120:2379]"] [2020/05/28 14:32:36.714 +08:00] [INFO] [client.go:252] ["[pd] switch leader"] [new-leader=http://192.168.15.118:2379] [old-leader=] [2020/05/28 14:32:36.714 +08:00] [INFO] [client.go:163] ["[pd] init cluster id"] [cluster-id=6815852588055789040] [2020/05/28 14:32:36.714 +08:00] [INFO] [server.go:115] [“get cluster id from pd”] [id=6815852588055789040] [2020/05/28 14:32:36.716 +08:00] [FATAL] [main.go:50] [“create drainer server failed”] [error=“initialize mysql type checkpoint with config &{CheckpointType:mysql Db:0xc0003cfcc0 Schema:tidb_binlog Table:checkpoint ClusterID:6815852588055789040 InitialCommitTS:416956333467107331 CheckPointFile:/home/tidb/deploy/data.drainer/savepoint}: exec failed, sql: create schema if not exists tidb_binlog: Error 1045: Access denied for user ‘root’@‘127.0.0.1’ (using password: NO)”] [errorVerbose=“Error 1045: Access denied for user ‘root’@‘127.0.0.1’ (using password:
exec failed, sql: create schema if not exists tidb_binlog: Error 1045: Access denied for user ‘root’@‘127.0.0.1’ (using password: NO)”

检查下是不是权限问题?