1、数据的导入导出

2、查询结果的重定向

3、ON DUPLICATE KEY UPDATE对于指定的主键或者唯一键,insert时发生冲突则进行update操作。

4、解决MySQL中问乱码问题,分了5.7版本、8.0版本

Microsoft Windows [版本 10.0.17763.805]
(c) Microsoft Corporation。保留所有权利。 C:\Users\lfy>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7.-log MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%char%';
+--------------------------+---------------------------------------------------------+
| Variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.7\share\charsets\ |
+--------------------------+---------------------------------------------------------+
rows in set, warning (0.01 sec) mysql>

...
# CLIENT SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
default-character-set=utf8 # [CLIENT_PIPE]=""
# pipe= # [CLIENT_SOCKET]="socket"
# socket= # [CLIENT_PORT]="port"
port= [mysql]
no-beep # [CLIENT_DEFAULT_CHARACTER_SET]=""
# default-character-set=
default-character-set=utf8 [database]
default-character-set=utf8 [server]
default-character-set=utf8 # SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
# [SERVER_TYPE]="server_type"
# server_type=
[mysqld]
character-set-server=utf8 # The next three options are mutually exclusive to SERVER_PORT below.
# [SERVER_SKIP]=""
# skip-networking=
# [SERVER_PIPE]=""
# enable-named-pipe=
# [SHARED_MEMORY]=""
# shared-memory=
...

==>>>

Microsoft Windows [版本 6.1.]
版权所有 (c) Microsoft Corporation。保留所有权利。 C:\Users\lfy>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 8.0. MySQL Community Server - GPL Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> show variables like '%char%';
-> ;
ERROR (): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near ';' a
t line
mysql> show variables like '%char%';
+--------------------------+----------------------------------------------------
-----+
| Variable_name | Value
|
+--------------------------+----------------------------------------------------
-----+
| character_set_client | utf8
|
| character_set_connection | utf8
|
| character_set_database | utf8mb4
|
| character_set_filesystem | binary
|
| character_set_results | utf8
|
| character_set_server | utf8mb4
|
| character_set_system | utf8
|
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 8.0\share\chars
ets\ |
+--------------------------+----------------------------------------------------
-----+
rows in set, warning (0.13 sec) mysql>

...
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]
default-character-set=utf8 # pipe= # socket=MYSQL port= [mysql]
no-beep # default-character-set=
default-character-set=utf8 # SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
# server_type=
[mysqld]
character-set-server=utf8 # The next three options are mutually exclusive to SERVER_PORT below.
# skip-networking
# enable-named-pipe
# shared-memory
...

MySQL-第N篇杂记的更多相关文章

  1. 学习mysql语法--基础篇(一)

      前  言  mysql  mysql语法--本篇学习都是通过使用Navicat Premium(数据库管理工具),连接mysql数据. 本篇学习主要有两个部分:    一.创建用户,创建数据库,给 ...

  2. 学习mysql语法--基础篇(二)

      前  言  mysql  mysql语法--本篇学习都是通过使用Navicat Premium(数据库管理工具),连接mysql数据. 本篇学习主要有两个部分: [SQL语句的组成]   DML ...

  3. mysql 开发进阶篇系列 55 权限与安全(安全事项 )

    一. 操作系统层面安全 对于数据库来说,安全很重要,本章将从操作系统和数据库两个层面对mysql的安全问题进行了解. 1. 严格控制操作系统账号和权限 在数据库服务器上要严格控制操作系统的账号和权限, ...

  4. mysql 开发进阶篇系列 47 物理备份与恢复(xtrabackup 的完全备份恢复,恢复后重启失败总结)

    一. 完全备份恢复说明 xtrabackup二进制文件有一个xtrabackup --copy-back选项,它将备份复制到服务器的datadir目录下.下面是通过 --target-dir 指定完全 ...

  5. mysql 开发进阶篇系列 46 物理备份与恢复( xtrabackup的 选项说明,增加备份用户,完全备份案例)

    一. xtrabackup 选项说明 在操作xtrabackup备份与恢复之前,先看下该工具的选项,下面记录了xtrabackup二进制文件的部分命令行选项,后期把常用的选项在补上.点击查看xtrab ...

  6. mysql 开发进阶篇系列 42 逻辑备份与恢复(mysqldump 的完全恢复)

    一.概述 在作何数据库里,备份与恢复都是非常重要的.好的备份方法和备份策略将会使得数据库中的数据更加高效和安全.对于DBA来说,进行备份或恢复操作时要考虑的因素大概有如下: (1) 确定要备份的表的存 ...

  7. mysql 开发进阶篇系列 20 MySQL Server(innodb_lock_wait_timeout,innodb_support_xa,innodb _log_*)

    1. innodb_lock_wait_timeout mysql 可以自动监测行锁导致的死锁并进行相应的处理,但是对于表锁导致的死锁不能自动监测,所以该参数主要用于,出现类似情况的时候等待指定的时间 ...

  8. 小白两篇博客熟练操作MySQL 之 第一篇

    小白两篇博客熟悉操作MySQL  之   第一篇 一.概述 1. 什么是数据库? 答: 储存数据的仓库, 如: 在ATM的事例中创建的一个db 目录, 称为数据库 2. 什么是Mysql, Oracl ...

  9. 小白两篇博客熟练操作MySQL 之 第二篇

    小白两篇博客熟练操作MySQL  之   第二篇 一. 视图 视图是一个虚拟表,其本质是根据SQL语句获取动态的数据集,并为其命名,用户使用时只需使用名称即可获取结果集, 并可以将其当做表来使用. s ...

  10. 《MySQL性能优化篇》阅读笔记

    建表的时候,不要用null赋默认值,如:字符串的设置'',数据类型的设为0,不要将null设为默认值. 在MySQL中没有 full [outer] join,用union代替 各种 JOIN SQL ...

随机推荐

  1. Could not load file or assembly system.data.sqlite.dll or one for it's depedencies

    最近做一个winform项目,因为数据库用的表很少,所以用的是轻量级数据库sqlite.sqlite的优点很多,但是他要分两个版本,32位或者64位,不能同时兼容. 我遇到的问题是,我在开发端用的是. ...

  2. Python之路-函数基础&局部变量与全局变量&匿名函数&递归函数&高阶函数

    一.函数的定义与调用 函数:组织好的.可重复使用的.用户实现单一或者关联功能的代码段.函数能够提高应用的模块性和代码的重复利用率.Python提供了很多内置的函数,比如len等等,另外也可以根据自己的 ...

  3. C# 实现实体类和Xml转换

    一.实体类转换成XML 将实体类转换成XML需要使用XmlSerializer类的Serialize方法,将实体类序列化 public static string XmlSerialize<T& ...

  4. 【转】一文搞懂C语言回调函数

    转:https://segmentfault.com/a/1190000008293902?utm_source=tag-newest 什么是回调函数 我们先来看看百度百科是如何定义回调函数的: 回调 ...

  5. 读书笔记二、pandas之DataFrame

    注:DataFrame的构造方法与Series类似,只不过同时接受一条一维数据源,每一条都会成为单独的一列. 注意,返回的Series拥有原DataFrame 相同的索引,且其name属性也已经被相应 ...

  6. this与super的区别

    调用super()的语句必须要写在子类构造方法的第一行. super()是在子类中调用父类的构造方法:this()是在同一类中调用其它方法. super()和this()都需要放在构造函数的第一行. ...

  7. maven 提取jar包 依赖及打包排除

    <properties> <project.targetDir>D:\jar</project.targetDir> <project.targetServe ...

  8. 转发一个robotframework的循环

    Click_Element Xpath=//b[text()='系统投放管理'] Sleep 1 Click_Element Xpath=//span[text()='全部投放情况查询'] Sleep ...

  9. Altium Designer 19 导出光绘文件

    一.点击 文件--制造输出--Gerber Files 第一次设置如下 绘制层点击进去全选 钻孔光圈 符号大小50mil 生成文件 关闭不用保存 蚀刻图 二.点击 文件--制造输出--Gerber F ...

  10. CSS中用 opacity、visibility、display 属性将 元素隐藏 的 对比分析

    说明 opacity 用来设置透明度 display 定义建立布局时元素生成的显示框类型 visibility 用来设置元素是否可见. opacity.visibility.display 这三个属性 ...