Schema backup recovery from MySQL 5.6 to 5.5

I am developing an application using mysql 5.6, now I have to install it on a production server using mysql 5.5. The problem is that the backup generated with mysqldump does not seem to be backward compatible.

How can I not change the mysql version on any of the computers. I'm looking for a way to export backward compatible data for 5.5 or a way to import data from 5.6.

I have an error:

ERROR 1064 (42000) at line 105: 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 '(6) DEFAULT NULL,
   `is_superuser` tinyint(1) NOT NULL,
   `username` varchar(30)' at line 4

problem code:

--
-- Table structure for table `auth_user`
--

DROP TABLE IF EXISTS `auth_user`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `auth_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `password` varchar(128) NOT NULL,
  `last_login` datetime(6) DEFAULT NULL,
  `is_superuser` tinyint(1) NOT NULL,
  `username` varchar(30) NOT NULL,
  `first_name` varchar(30) NOT NULL,
  `last_name` varchar(30) NOT NULL,
  `email` varchar(254) NOT NULL,
  `is_staff` tinyint(1) NOT NULL,
  `is_active` tinyint(1) NOT NULL,
  `date_joined` datetime(6) NOT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

Problems look like datetime(6)that are not accepted by mysql 5.5

+4
source share
1 answer

datetime(6) datetime .

.

+2

Source: https://habr.com/ru/post/1616605/


All Articles