shakir has asked for the wisdom of the Perl Monks concerning the following question:

Hello to all, I was working on my laptop it has linux mint(version 17) on it perl 5.18.2. I run the dbicdump and everything work fine. I dump sql databse and copied schema to my PC. On my PC linux mint(version 18.1) installed with the perl 5.22.1. My directory structure and database is same on the both machines. On PC schema from Mint 17 was not working so i tried to to run the dbicdump command. The following works fine on perl5.18.2, but perl 5.22.1 it gives error, When i run the dbicdump, i get
dbicdump Database::Schema dbi:mysql:database=Database 'user' 'password +' Dumping manual schema for Database::Schema to directory . ... Schema dump completed. Failed to reload class Database::Schema::Result::Author: sub name "yea +rs_rs" is not valid! at /usr/local/share/perl/5.22.1/DBIx/Class/Relat +ionship/Accessor.pm line 99. Compilation failed in require at (eval 114) line 2. And all Database::Schema::Result::Author printed in the console. (not showing becuause of the space it will take)
If i run the script then this error Shows up!
{UNKNOWN}: sub name "years_rs" is not valid! at /usr/local/share/perl/ +5.22.1/DBIx/Class/Relationship/Accessor.pm line 99. Compilation failed in require at /usr/local/share/perl/5.22.1/Class/C3 +/Componentised.pm line 150. at /usr/local/share/perl/5.22.1/Class/C3/ +Componentised.pm line 155

Perl version 5.22.1 DBIx::Class::Schema::Loader (0.07046) DBIx::Class (0.82840)

is there any solution for my this problem. Many thanks,

Replies are listed 'Best First'.
Re: dbicdump error
by poj (Abbot) on Jan 08, 2017 at 16:38 UTC

    Cross posted to stackoverflow

    What are the module versions in 5.18 ?

      Are the PC and laptop network connected ?. If so, try dbicdump on the PC against the database on the laptop and vice versa.

      poj
        I dont know how to do it, but perl 5.20 has mysql 5.7.20 but with perl 5.18 it is mysql 5.5.53. Would it make any differnce?
      I am trying all over the places,:-) On perl 5.18, modules have same numbers.
Re: dbicdump error
by shakir (Novice) on Jan 09, 2017 at 10:34 UTC
    I found out that it has to do with the 'foreign key' in the data. one table is
    CREATE TABLE `authors` ( `id` INT(50) NOT NULL AUTO_INCREMENT, `authorName` TINYTEXT NOT NULL, `aboutAuthor` TINYTEXT NOT NULL, PRIMARY KEY (`id`) ) COLLATE='latin1_swedish_ci' ENGINE=InnoDB ;
    and other table is
    CREATE TABLE `295c` ( `id` INT(50) NOT NULL AUTO_INCREMENT, `fileName` VARCHAR(40) NULL DEFAULT NULL, `file_link` VARCHAR(40) NULL DEFAULT NULL, `file_toolTips` VARCHAR(40) NULL DEFAULT NULL, `image` VARCHAR(100) NOT NULL DEFAULT '/img/IconFlag.png', `content` TEXT NOT NULL, `author` INT(50) NOT NULL, `keywords` VARCHAR(80) NULL DEFAULT NULL, `timemade` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), INDEX `FK__authors` (`author`), CONSTRAINT `FK__authors` FOREIGN KEY (`author`) REFERENCES `author +s` (`id`) )COLLATE='latin1_swedish_ci' ENGINE=InnoDB ;
    these simple tables are giving me the error, Any solution, Many thanks,