Mycli also reads the [client] section of MySQL’s option file, ~/.my.cnf (on Windows: C:\Users\<username>\.my.cnf). See the example file at the bottom of this page for more information.
1 2 3 4 5 6 7 8
[client] # The client section is read by mycli and all MySQL applications. ..... # Turn on the LOAD DATA INFILE statement local-infile = on
❯ mysql -uroot -p123456 -P3305 k8s_grafana < ~/backup/k8s_grafana_data.sql
test
1 2 3 4
#查出结果复制执行,清空表数据 SELECT CONCAT('truncate table ',TABLE_NAME,';') AS a FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'k8s_grafana' ; #查出结果复制执行,清空表 SELECT concat('DROP TABLE IF EXISTS ', table_name, ';') FROM information_schema.tables WHERE table_schema = 'k8s_grafana';