david123 has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to use DBIx::Class::Schema::Loader to create schema from an existing MySQL database?
by kcott (Archbishop) on Aug 01, 2013 at 04:49 UTC | |
by david123 (Initiate) on Aug 01, 2013 at 05:22 UTC | |
by kcott (Archbishop) on Aug 01, 2013 at 06:39 UTC | |
|
Re: How to use DBIx::Class::Schema::Loader to create schema from an existing MySQL database?
by Loops (Curate) on Aug 01, 2013 at 04:13 UTC | |
by david123 (Initiate) on Aug 01, 2013 at 04:27 UTC |