Error 1067: Invalid default value for created_at
up vote
-1
down vote
favorite
Im trying to import my sql file backup to my new server, but i receive error:
Error 1067: Invalid default value for created_at
this is my SQL file header:
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 07, 2018 at 07:43 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `.....
Error:
i added sql_mode line inside the conf file at:
/etc/mysql/my.cnf
restart mysql and apache2, but still not resolved
any idea please?
mysql
add a comment |
up vote
-1
down vote
favorite
Im trying to import my sql file backup to my new server, but i receive error:
Error 1067: Invalid default value for created_at
this is my SQL file header:
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 07, 2018 at 07:43 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `.....
Error:
i added sql_mode line inside the conf file at:
/etc/mysql/my.cnf
restart mysql and apache2, but still not resolved
any idea please?
mysql
1
What is your MySQL version ?Current_Timestamp
is not supported by older versions
– Madhur Bhaiya
Nov 7 at 13:47
Server version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
– rilucu
Nov 7 at 13:50
it will be better to go with mysql 8 and ubuntu 18?
– rilucu
Nov 7 at 13:56
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
Im trying to import my sql file backup to my new server, but i receive error:
Error 1067: Invalid default value for created_at
this is my SQL file header:
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 07, 2018 at 07:43 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `.....
Error:
i added sql_mode line inside the conf file at:
/etc/mysql/my.cnf
restart mysql and apache2, but still not resolved
any idea please?
mysql
Im trying to import my sql file backup to my new server, but i receive error:
Error 1067: Invalid default value for created_at
this is my SQL file header:
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 07, 2018 at 07:43 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `.....
Error:
i added sql_mode line inside the conf file at:
/etc/mysql/my.cnf
restart mysql and apache2, but still not resolved
any idea please?
mysql
mysql
edited Nov 7 at 13:50
O. Jones
58.6k971106
58.6k971106
asked Nov 7 at 13:46
rilucu
13
13
1
What is your MySQL version ?Current_Timestamp
is not supported by older versions
– Madhur Bhaiya
Nov 7 at 13:47
Server version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
– rilucu
Nov 7 at 13:50
it will be better to go with mysql 8 and ubuntu 18?
– rilucu
Nov 7 at 13:56
add a comment |
1
What is your MySQL version ?Current_Timestamp
is not supported by older versions
– Madhur Bhaiya
Nov 7 at 13:47
Server version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
– rilucu
Nov 7 at 13:50
it will be better to go with mysql 8 and ubuntu 18?
– rilucu
Nov 7 at 13:56
1
1
What is your MySQL version ?
Current_Timestamp
is not supported by older versions– Madhur Bhaiya
Nov 7 at 13:47
What is your MySQL version ?
Current_Timestamp
is not supported by older versions– Madhur Bhaiya
Nov 7 at 13:47
Server version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
– rilucu
Nov 7 at 13:50
Server version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
– rilucu
Nov 7 at 13:50
it will be better to go with mysql 8 and ubuntu 18?
– rilucu
Nov 7 at 13:56
it will be better to go with mysql 8 and ubuntu 18?
– rilucu
Nov 7 at 13:56
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
Colums with the CURRENT_TIMESTAMP
attribute must have the data type TIMESTAMP
, not DATETIME
, in MySQL versions prior to 5.6.
So you need
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
or a later version of MySQL.
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
Colums with the CURRENT_TIMESTAMP
attribute must have the data type TIMESTAMP
, not DATETIME
, in MySQL versions prior to 5.6.
So you need
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
or a later version of MySQL.
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
add a comment |
up vote
0
down vote
accepted
Colums with the CURRENT_TIMESTAMP
attribute must have the data type TIMESTAMP
, not DATETIME
, in MySQL versions prior to 5.6.
So you need
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
or a later version of MySQL.
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Colums with the CURRENT_TIMESTAMP
attribute must have the data type TIMESTAMP
, not DATETIME
, in MySQL versions prior to 5.6.
So you need
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
or a later version of MySQL.
Colums with the CURRENT_TIMESTAMP
attribute must have the data type TIMESTAMP
, not DATETIME
, in MySQL versions prior to 5.6.
So you need
`created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP
or a later version of MySQL.
answered Nov 7 at 13:56
O. Jones
58.6k971106
58.6k971106
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
add a comment |
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
ubuntu 18 and mysql 8 will fix it without to edit the sql?
– rilucu
Nov 7 at 13:58
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
by the way, it fixed the problem thank you very much:) i edited the lines to TIMESTAMP and now its fine.
– rilucu
Nov 7 at 14:04
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
The operating system version doesn't matter. Any MySQL version 5.6.4 or better will deal with this problem, as will changing the column definition.
– O. Jones
Nov 7 at 15:57
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53190722%2ferror-1067-invalid-default-value-for-created-at%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What is your MySQL version ?
Current_Timestamp
is not supported by older versions– Madhur Bhaiya
Nov 7 at 13:47
Server version: 5.5.62-0ubuntu0.14.04.1 - (Ubuntu)
– rilucu
Nov 7 at 13:50
it will be better to go with mysql 8 and ubuntu 18?
– rilucu
Nov 7 at 13:56