问题:

我这里时应为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        = 3306  socket      = /tmp/mysql.sock   # Here follows entries for some specific programs  # The MySQL server  [mysqld]character-set-server=utf8init_connect='SET NAMES utf8port        = 3306  socket      = /tmp/mysql.sock  skip-external-locking  key_buffer_size = 16M  max_allowed_packet = 1M  table_open_cache = 64  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 1 and 2^32 - 1  # defaults to 1 if master-host is not set  # but will not function as a master if omitted  server-id   = 1  # Replication Slave (comment out master section to use this)  #  # To configure this host as a replication slave, you can choose between  # two methods :  #  # 1) 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=3306,  #    MASTER_USER='joe', MASTER_PASSWORD='secret';  #  # OR  #  # 2) 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 2 and 2^32 - 1  # (and different from the master)  # defaults to 2 if master-host is set  # but will not function as a slave if omitted  #server-id       = 2  #  # 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 3306  #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 50 - 80 %  # 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 25 % of buffer pool size  #innodb_log_file_size = 5M  #innodb_log_buffer_size = 8M  #innodb_flush_log_at_trx_commit = 1  #innodb_lock_wait_timeout = 50  [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  参数可以看下

转载于:https://www.cnblogs.com/renjianjun/p/10249487.html

Mac mysql sql_model引起的问题相关推荐

  1. mac mysql密码错误_解决mac 下mysql安装后root用户登录密码错误问题

    使用的mac OS 10.11  安装mysql后访问root/root用户失败,网上找了一些解决办法,下面记录下解决方法方便以后自己查询 概述(看懂下面就不用看了): 停服务:sudo /usr/l ...

  2. mac mysql 忘记初始root密码,重置密码

    mac mysql 忘记初始root密码,重置密码 cd /usr/local/mysql/bin/ sudo su //回车后提示输入密码,这里的密码切记是电脑管理员的密码,我之前一直以为是mysq ...

  3. Mac MySQL忘记root密码

    Mac MySQL忘记root密码 本文转载自Mac MySql忘记root密码! 刚刚在Mac上安装了下MySQL,但是发现不知道root密码是什么!所以,查找别人的博客,亲测可用,做个记录. 第一 ...

  4. 【Mysql】 Mac Mysql密码重置

    Mac Mysql密码重置 Mac系统 1.切换到root用户: 方式一:完全切换到root用户,回车输入电脑的密码 su - root 方式二:当前用户临时获得root权限 su 或 sudo su ...

  5. Mac MySQL设置密码

    2017-06-12T10:21:47.854165Z 1 [Note] A temporary password is generated for root@localhost: 7hp<_l ...

  6. mac mysql phpmyadmin_Mac下搭建PHP开发环境(Apache+PHP+MySQL+phpMyAdmin)

    备注:OS 10.11 自带Apache 2.4.18和PHP 5.5:(升级macOS Sierra后Apache 2.4.23和PHP 5.6.24) 1. 运行Apache(根目录:/Libra ...

  7. mac mysql的安装

    mac是重装的系统,很干净,没有xmpp等组合的服务器. 1. 安装mysql server https://dev.mysql.com/downloads/mysql/ 这里是官网地址,选择需要的版 ...

  8. Mac MySQL 数据库配置(关系型数据库管理系统)

    本文已停止更新,点击此链接查看本文最新内容 !!! 前言 MySQL 关系型数据库管理系统. 1.配置准备工作 1)配置数据库准备工作 下载相关软件 mysql-5.7.21-1-macos10.13 ...

  9. mac mysql 链接_Mysql mac安装以及navicat链接

    安装mysql 系统版本:macOS Mojave 10.14.6 安装的方式是使用Homebrew 包管理工具. # 安装命令 brew install mysql 安装完成之后会有相应的提示,开启 ...

最新文章

  1. 《C++游戏编程入门(第4版)》——1.8 Lost Fortune简介
  2. 在Visual Studio 2010/2012中 找不到创建WebService的项目模板
  3. DATAGUARD配置错误的解决日志
  4. sprint冲刺计划第三天团队任务
  5. Python Pycharm创建虚拟环境
  6. 弹性盒怎么实现左边图片右边文字_【粉丝问题】如何用ps修改照片中的文字数字?...
  7. GJB 150A军用设备环境试验方法低气压(高度)试验测试报告
  8. web压力测试工具(小而精)
  9. 南邮JAVA程序设计实验3 流处理程序设计
  10. 安全公司发现雄迈数字摄像机的主控口令“已泄露”
  11. CST软件基本操作—1
  12. java练习题,个人所得税计算
  13. 微软拼音清除自定义短语的方法
  14. java 打砖块算法_打砖块java代码详细
  15. Flink报错:exceeded checkpoint tolerable failure threshould
  16. 基于ArcGIS水文分析、HEC-RAS模拟技术在洪水危险性及风险评估
  17. 学生管理系统-C++版
  18. 帕德逼近matlab算法,帕德逼近算法.doc
  19. 微信公众号开通留言功能方法
  20. Win10系统默认的输入法如何设置

热门文章

  1. ORACLE 数据字典
  2. 地理信息系统控件GIS控件TatukGIS Developer Kernel 下载及介绍
  3. [分类整理IV]微软等100题系列V0.1版:字符串+数组面试题集锦
  4. Silverlight学习笔记之使用TranslateTransform控制对象位置
  5. Java的缓存使用-Ehcache
  6. 80行代码搞定某电影网站所有的下载资源
  7. webpack2诸类事宜
  8. java.io.IOException: No FileSystem for scheme: hdfs
  9. 使用Windows Live Writer发布日志
  10. 什么是闭包,我的理解