[Rt-commit] r19345 - in rt/3.8/trunk: .
falcone at bestpractical.com
falcone at bestpractical.com
Fri Apr 24 16:17:37 EDT 2009
Author: falcone
Date: Fri Apr 24 16:17:36 2009
New Revision: 19345
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/UPGRADING.mysql
rt/3.8/trunk/etc/upgrade/upgrade-mysql-schema.pl
Log:
r46850 at ketch: falcone | 2009-04-20 14:47:40 -0400
* contributed patch to allow upgrade-mysql-schema.pl to connect
to mysql on a remote server
Modified: rt/3.8/trunk/UPGRADING.mysql
==============================================================================
--- rt/3.8/trunk/UPGRADING.mysql (original)
+++ rt/3.8/trunk/UPGRADING.mysql Fri Apr 24 16:17:36 2009
@@ -27,6 +27,11 @@
perl etc/upgrade/upgrade-mysql-schema.pl db user pass > sql.queries
+If your mysql database is on a remote host, you can run the script
+like this instead
+
+ perl etc/upgrade/upgrade-mysql-schema.pl db:host user pass > sql.queries
+
5) Check sanity of the SQL queries yourself or consult with your DBA.
6) Apply the queries. Note that this step can take a while. It may require
Modified: rt/3.8/trunk/etc/upgrade/upgrade-mysql-schema.pl
==============================================================================
--- rt/3.8/trunk/etc/upgrade/upgrade-mysql-schema.pl (original)
+++ rt/3.8/trunk/etc/upgrade/upgrade-mysql-schema.pl Fri Apr 24 16:17:36 2009
@@ -7,7 +7,7 @@
use DBD::mysql 4.002;
unless (@ARGV) {
- print STDERR "usage: $0 db_name db_user db_password\n";
+ print STDERR "usage: $0 db_name[:server_name] db_user db_password\n";
exit 1;
}
@@ -211,8 +211,10 @@
my @sql_commands;
-my ($db_name, $db_user, $db_pass) = (shift, shift, shift);
-my $dbh = DBI->connect("dbi:mysql:$db_name", $db_user, $db_pass, { RaiseError => 1 });
+my ($db_datasource, $db_user, $db_pass) = (shift, shift, shift);
+my $dbh = DBI->connect("dbi:mysql:$db_datasource", $db_user, $db_pass, { RaiseError => 1 });
+my $db_name = $db_datasource;
+$db_name =~ s/:.*$//;
my $version = ($dbh->selectrow_array("show variables like 'version'"))[1];
($version) = $version =~ /^(\d+\.\d+)/;
More information about the Rt-commit
mailing list