当前位置:网站首页>mysql笔记
mysql笔记
2022-06-22 12:22:00 【漂泊的猎人】
mysql笔记
一、脚本导入导出
1、导出数据
A、mysqldump -u root -p dbname -P 3308 > lmapp.sql
mysqldump -u 用户名-p 数据库名 -P 端口号> 导出文件名称.sql
B、mysqldump -u root -p dbname table -P 3308 > lmapp.sql
mysqldump -u 用户名-p 数据库名 表名 -P 端口号> 导出文件名称.sql
2、数据库导入
mysql -uroot -p
source 脚本名称.sql
二、问题解决
1、Access denied for user ‘root‘@‘%to database ‘xxx‘
可以查看用户授权信息:show grants;
授权:grant all privileges on *.* to 'root'@'%' identified by 'xxx此处为密码xxx' with grant option;
刷新:flush privileges;
三、常用命令
1、查看当前进程
show processlist;
四、脚本
1、唯一索引
alter table aaa add UNIQUE `IDX_MODEL_CODE_TYPE` (`MODEL_CODE`,`TYPE`)
2、创建修改时间自动赋值当前时间
`CREATE_TIME` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`UPDATE_TIME` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
边栏推荐
- Detailed explanation of rules and ideas for advance sale of deposit
- Shutter & flame - tankcombat game console development (I)
- Isn't the execution process of ODPs SQL executed from top to bottom
- Flutter实现网易音乐登录页的波纹效果
- [MySQL] the difference between where and having
- SAP SPRO configure how to display the corresponding t-code
- CVPR 2022 | visual language model pre training for scene text detection
- JAXB元素详解
- MySQL_数据处理之查询
- [game] Zhou Yu's skills
猜你喜欢

天翼云数字政府智慧数据中台通过认证

Sequoiadb distributed database may 2022 issue

天翼云探索云原生、边缘计算融合新思路

智龄语音+php

Sliding conflict handling effect of cloud music imitating Netease

Final of the 13th Blue Bridge Cup embedded design and development project

SAP-ABAP-BAPI_GOODSMVT_CREATE创建物料凭证bapi的各种情况如何赋值

MySQL_数据处理之查询

Getting started with webrtc: 11 In kurento, rtendpoint is used to pull RTP streams for clustering in live broadcast

SAP 系统取消用户设置ALV全局布局
随机推荐
Flutter version Parallax effect of Zhihu list
帝云CMS升级PHP8注意事项
SAP fi financial statement version setting
Making rectangular border according to metric system through PostGIS
这不会又是一个Go的BUG吧?
Sap-mm-migo 311 intra factory transfer inventory
Es aggregation details
View the GStreamer plug-in
Under Xinchuang: when the domestic database stars shine
Isn't this another go bug?
MySQL_ Create and manage tables
Let's see how the SQL fails to execute
关于 GIN 的路由树
SAP-ABAP-BAPI_GOODSMVT_CREATE创建物料凭证bapi的各种情况如何赋值
Shutter & flame - tankcombat game console development (I)
SNC processing failed SAP Router证书重新生成
8 challenges of BSS application cloud native deployment
SAP 客户端中文显示乱码问题
Tianyi cloud digital government smart data center has passed the certification
修复flutter_webview_plugin在页面滑出时web图层残留的问题