问题:

我这里时应为timestamp引起的,服务器的数据使用的mysql5。本地使用的是mysql8,sql_model 不同导致数据不能够在数据库中添加。

解决:

在/etc/下查找my.cnf文件,如果有就使用,没有新建一个my.cnf文件,

然后开始编辑,sudo vi /etc/my.cnf

具体内容如下,网上找的。然后就是问题关键所在了。sql_model的配置

需要在

  [mysqld]

  sql_mode=''

我这里图省事,就写了空。可以找几个网站,去查看每个选项的作用

# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
#
# In this file, you can use all long options that a program supports.
# If you want to know which options a program supports, run the program
# with the "--help" option.
# The following options will be passed to all MySQL clients
[client]
default-character-set=utf8
#password = your_password
port =
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
character-set-server=utf8
init_connect='SET NAMES utf8
port =
socket = /tmp/mysql.sock
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache =
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
character-set-server=utf8
init_connect='SET NAMES utf8'
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking # Replication Master Server (default)
# binary logging is required for replication
log-bin=mysql-bin # binary logging format - mixed recommended
binlog_format=mixed # required unique id between and ^ -
# defaults to if master-host is not set
# but will not function as a master if omitted
server-id = # Replication Slave (comment out master section to use this)
#
# To configure this host as a replication slave, you can choose between
# two methods :
#
# ) Use the CHANGE MASTER TO command (fully described in our manual) -
# the syntax is:
#
# CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
# MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
#
# where you replace <host>, <user>, <password> by quoted strings and
# <port> by the master's port number (3306 by default).
#
# Example:
#
# CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=,
# MASTER_USER='joe', MASTER_PASSWORD='secret';
#
# OR
#
# ) Set the variables below. However, in case you choose this method, then
# start replication for the first time (even unsuccessfully, for example
# if you mistyped the password in master-password and the slave fails to
# connect), the slave will create a master.info file, and any later
# change in this file to the variables' values below will be ignored and
# overridden by the content of the master.info file, unless you shutdown
# the slave server, delete master.info and restart the slaver server.
# For that reason, you may want to leave the lines below untouched
# (commented) and instead use CHANGE MASTER TO (see above)
#
# required unique id between and ^ -
# (and different from the master)
# defaults to if master-host is set
# but will not function as a slave if omitted
#server-id =
#
# The replication master for this slave - required
#master-host = <hostname>
#
# The username the slave will use for authentication when connecting
# to the master - required
#master-user = <username>
#
# The password the slave will authenticate with when connecting to
# the master - required
#master-password = <password>
#
# The port the master is listening on.
# optional - defaults to
#master-port = <port>
#
# binary logging - not required for slaves, but recommended
#log-bin=mysql-bin # Uncomment the following if you are using InnoDB tables
#innodb_data_home_dir = /usr/local/mysql/data
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = /usr/local/mysql/data
# You can set .._buffer_pool_size up to - %
# of RAM but beware of setting memory usage too high
#innodb_buffer_pool_size = 16M
#innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to % of buffer pool size
#innodb_log_file_size = 5M
#innodb_log_buffer_size = 8M
#innodb_flush_log_at_trx_commit =
#innodb_lock_wait_timeout = [mysqldump]
quick
max_allowed_packet = 16M [mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates
default-character-set=utf8 [myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 2M
write_buffer = 2M [mysqlhotcopy]
interactive-timeout

下一步可能需要权限

sudo chmod 664 /etc/my。cnf

https://blog.csdn.net/wyzxg/article/details/8787878  参数可以看下

Mac mysql sql_model引起的问题的更多相关文章

  1. Mac mySql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)的解决办法

    我的环境:Mac 10.11.6 ,mysql  5.7.14  . mac mySql 报错ERROR 2002 (HY000): Can't connect to local MySQL serv ...

  2. Mac mysql 解决中文乱码

    Mac mysql 解决中文乱码问题 出现"???"之类的无法识别的乱码 到/etc目录下自己建一个my.cnf文件(需要最高权限,使用sudo su),然后写入内容: [clie ...

  3. Mac - MySQL初始密码忘记重置MySQL root密码

    在什么情况下,需要重置root密码呢?那就是我们忘记了.还有一种比较坑的,那就是笔者的这种情况.按照正常的情况下,MySQL安装完之后,会弹出一个对话框,显示着一个临时的root密码,但无论笔者如何重 ...

  4. mac mysql 编码配置

    mac mysql 编码配置 (mysql目录下没有my.cnf) 想要修改编码发现自己的/usr/local/mysql/support-files里面根本没有my.cnf 安装方式是去mysql官 ...

  5. Mac Mysql [ERR] 2006 - MySQL server has gone away

    Mac mysql 安装后,导入sql数据,出现这个错误: 处理方式,是因为sql文件太大,需要修改mysql的配置.如果没有my.cnf就自己建一个. cd /etc sudo vim my.cnf ...

  6. mac mysql 使用注意事项

    mac mysql 使用注意事项 .安装 直接通过下载官网上的dmg安装包进行安装,mysql--osx10.-x86_64(我的安装文件) ,安装完成后在系统偏好设置里面有mysql选项,我们可以通 ...

  7. Mac Mysql 5.6.4修改初始化密码

    Mac Mysql 修改初始化密码   第一步: 点击系统偏好设置->最下边点MySQL,在弹出页面中,关闭服务 第二步:进入终端输入:cd /usr/local/mysql/bin/回车后 登 ...

  8. mac使用终端运行mysql,mysql终端,mysql mac,mysql目录,mysql路径

    首先去官网下载: http://www.mysql.com/downloads/ 我下载了5.6.11的dmg然后安装,安装完成之后..如果要用终端去玩SQL.那么一开始要输入很长的:/usr/loc ...

  9. Mac Mysql初始密码重置

    今天晚上mac更新后重装MySQL 安装完成后 启动服务,死活登录不了 提示1045错误.按照网上的资料对MySQL密码进行重置.记录步骤如下: 1.首先关闭MySQL服务 系统偏好设置->最下 ...

随机推荐

  1. react-native ios打包 、设置图标 启动图片

    在这里只记录xcode 打包操作,申请证书操作,之前已经记录过了. https://www.cnblogs.com/hellovoidworld/p/4127576.html  参考了这篇文章,只是可 ...

  2. maven eclipse操作

    目前eclipse默认集成maven插件,但要在eclipse中配置maven的setting才可以. setting可以选用mvn解压包下的目录,也可用仓库下的settings文件. 因我们需要结合 ...

  3. maven的环境变量配置

    一: 首先下载maven, 下载地址:http://maven.apache.org/download.html 打开这个连接:选择File下面的apache-maven-3.2.1-bin.zip链 ...

  4. xcode 自动签名、手动签名

    手动签名:需要手动生成p12文件(私钥),然后将对应的公钥上传到开发者网站,生成证书,进一步生成对应的描述文件,然后在xcode中手动指定描述文件,这个描述文件中包含与本地p12文件对应的证书. 自动 ...

  5. Spark、Hadoop、Hive相关文章

    1.Spark On Yarn(HDFS HA)详细配置过程 2.Hive安装与配置详解

  6. 【389】Implement N-grams using NLTK

    Ref: Natural Language Toolkit Ref: n-grams in python, four, five, six grams? Ref: "Elegant n-gr ...

  7. Python调用外部系统命令

    利用Python调用外部系统命令的方法可以提高编码效率.调用外部系统命令完成后可以通过获取命令执行返回结果码.执行的输出结果进行进一步的处理.本文主要描述Python常见的调用外部系统命令的方法,包括 ...

  8. Linux创建SSH信任关系

    Linux服务器创建信任关系可以解决远程执行命令.远程传输文件多次手工输入的麻烦.可以实现环境一键打包备份. 测试环境 SuSE 手工创建 假设服务器A与B间要建立信任关系.用户想从服务器A免密码登录 ...

  9. KVM虚拟化技术(五)虚拟机管理

    一.为了提高内存.硬盘.网络的性能,需要支持半虚拟化:virtio半虚拟化驱动 二.对虚拟机的管理都是通过libvirt:所有必须要启用一个守护程序libvirtd. 三.virt-manager ① ...

  10. ArcGIS案例学习笔记-批处理擦除挖空挖除相减

    ArcGIS案例学习笔记-批处理擦除挖空挖除相减 联系方式:谢老师,135-4855-4328,xiexiaokui#qq.com 目的:批处理擦除.挖空.挖除.相减 数据源:chp13/ex5/pa ...