mysql datatime 设置默认值为CURRENT_TIMESTAMP报错`Invalid default value`

时间:2022-05-10 09:59:24

环境:

Ubuntu

mysql 5.5

解决方法:

升级mysql至5.6

apt-cache search mysql-server
sudo  apt-add-repository ppa:ondrej/mysql-5.6
sudo apt-get update
apt-cache search mysql-server
apt-get -y install mysql-server
参考:
http://birdinroom.blog.51cto.com/7740375/1426651