初始化MySQL数据库
mysql> show databases;
mysql> CREATE DATABASE 数据库名;
mysql> use 数据库名;
mysql> source XXX.sql; #导入数据库
mysql> show tables;
mysql> desc 表名;
mysql> drop database 数据库名;
status;
show databases;
MySQL数据导出到表
MySql数据库导出csv
MYSQL导出数据出现The MySQL server is running with the --secure-file-priv option so it cannot execute this
将Mysql的一张表导出至Excel
pandas和数据库进行交互(以mysql为例)
mysql> show variables like '%secure%';
# secure_path
mysql> select * from table_name into outfile 'secure_path/file_name.csv' fields terminated by ',' optionally enclosed by '' lines terminated by '\n';
网友评论