Greetings monks,

I am trying to use DBIx::Class::Schema::Loader to create schema from an existing MySQL database. I used the  make_schema_at method like this:

C:\xampp\perl\bin>perl -MDBIx::Class::Schema::Loader=make_schema_at,du +mp_to_dir:.\lib -e "make_schema_at('turboimmisoft::Schema', ['dbi::my +sql::dbname=t urboimmisoft', 'root', ''])"

where: turboimmisoft is the name of my database

I got the following error message:

Reference found where even-sized list expected at C:/xampp/perl/site/l +ib/DBIx/Class/Schema/Loader.pm line 165. DBIx::Class::Storage::DBI::_connect(): You did not provide any connect +ion_info at -e line 1

I am using ActivePerl 5.14.4 on Windows Vista and the path the the MySQL database is: "C:\xampp\mysql\data\". The path to perl.exe is: "C:\xampp\perl\bin\"

To connect to the MySQL database with DBI (not DBIx::Class), I use:

use DBI; my $driver = "mysql"; my $database = "turboimmisoft"; my $dsn = "DBI:$driver:database=$database"; my $userid = "root"; my $password = ""; my $dbh = DBI->connect($dsn, $userid, $password) #, {RaiseError => 1 +, AutoCommit => 1} or die "Could not connect to database:$DBI::errstr";

Any help will be appreciated. I am new to DBIx::Class but I have been using DBI since 2007.

Do I have to create new folders in the DBIx::Class folder for the new schema?


In reply to How to use DBIx::Class::Schema::Loader to create schema from an existing MySQL database? by david123

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.