当前位置:网站首页>本机mysql
本机mysql
2022-07-06 20:38:00 【Darin2017】
1、dos操作
cd 进入bin目录下;
mysql -hlocalhost -uroot -p。。。登录
show databases显示数据库;
use 库名;show tables显示数据表
2、
首先输入代码 show variables like 'local_infile'; 查看是否开启本地文件导入权限 若Value为ON 则,本地文件导入权限开启。
否则输入代码 set global local_infile = 1;开启权限。 在workbench database菜单下的连接设置界面,advanced窗口的others里添加以下代 码 OPT_LOCAL_INFILE=1
show variables like 'local_infile';
set global local_infile = 1;
在workbench database菜单下的连接设置界面,advanced窗口的others里添加以下代 码 OPT_LOCAL_INFILE=1
打开还是如此则在manage connections 中添加OPT_LOCAL_INFILE=1
3、
mysql安装目录下找到文件my.ini在最下边添加配置:
[mysqld]
secure_file_priv=D:\\mysql_import
[mysqld]
local_infile=1
cmd管理员身份进入,net stop mysql关闭服务,net start mysql重启服务
通过show variables like '%secure_file_priv%';
show variables like '%local%' 查看是否已更新;
4、workbench上传csv文件太慢处理方案:
cmd启动mysql; truncate mysql.sdi_tb001清空表, LOAD DATA INFILE 'D:\\mysql_import\\000.csv' INTO TABLE mysql.sdi_tb001 FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' IGNORE 1 LINES;上传数据(速度10秒100万条大概)
5、cmd导入csv文件时日期格式不匹配
load data infile 'D:\\mysql_import\\sdi20220706.csv' into table sdi_tb fields terminated by ',' lines terminated by '\r\n' ignore 1 lines
(edition_name,course_name,dttype,@var1,shifen,gongying,xuqiu,sdi)
set riqi= STR_TO_DATE(@var1,'%d/%m/%Y') ;
边栏推荐
- Basic concepts of Huffman tree
- 注意力机制原理
- HDU 4337 King Arthur' S Knights it outputs a Hamiltonian circuit
- 1200.Minimum Absolute Difference
- PIP download only, not install
- 1200.Minimum Absolute Difference
- Jericho turns on the display icon of the classic Bluetooth hid mobile phone to set the keyboard [chapter]
- R数据分析:cox模型如何做预测,高分文章复现
- Opencv environment, and open a local PC camera.
- Jerry's phonebook acquisition [chapter]
猜你喜欢
Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
21. (article ArcGIS API for JS) ArcGIS API for JS rectangular acquisition (sketchviewmodel)
How to customize the shortcut key for latex to stop running
【安全攻防】序列化与反序列,你了解多少?
Variables, process control and cursors (MySQL)
Sub pixel corner detection opencv cornersubpix
R data analysis: how to predict Cox model and reproduce high score articles
Decoration design enterprise website management system source code (including mobile source code)
VHDL实现任意大小矩阵乘法运算
QT 项目 表格新建列名称设置 需求练习(找数组消失的数字、最大值)
随机推荐
Flutter3.0了,小程序不止于移动应用跨端运行
数学归纳与递归
Open3D 网格滤波
Jerry's ble exiting Bluetooth mode card machine [chapter]
A 股指数成分数据 API 数据接口
About Estimation Statistics
22.(arcgis api for js篇)arcgis api for js圆采集(SketchViewModel)
注意力机制原理
Stored procedures and functions (MySQL)
[dream database] add the task of automatically collecting statistical information
LAB1配置脚本
[leetcode] 700 and 701 (search and insert of binary search tree)
卡尔曼滤波-1
1200.Minimum Absolute Difference
哈夫曼树基本概念
Tencent cloud native database tdsql-c was selected into the cloud native product catalog of the Academy of communications and communications
SSL证书部署
Baidu map JS development, open a blank, bmapgl is not defined, err_ FILE_ NOT_ FOUND
Install torch 0.4.1
Enumeration general interface & enumeration usage specification