I'm trying to create a script that will migrate a PostgreSQL database to MySQL. The logic seems to be sound, but I'm having some kind of odd connection problems... Here's the PHP snippet in question (which is using Pear DB):
//Include the Pear DB library
require_once "DB.php";
//PostgreSQL connection string
$pgdsn = "pgsql://sgrover:[EMAIL PROTECTED]/open2space2";
//MySQL connection string
$mydsn = "mysql://drupal:[EMAIL PROTECTED]/devo2s";
//Connect to the databases
$pgdb = DB::connect($pgdsn, true);
//handle connection error
if (DB::isError($pgdb)) {
die ("\nPostgreSQL: " . $pgdb->getMessage() . "\n");
}
$mydb = DB::connect($mydsn, true);
//handle connection error
if (DB::isError($mydb)) {
die ("\nMySQL: " . $mydb->getMessage() . "\n");
}
When I try to run this I see the following:
MySQL: DB Error: connect failed
I've checked my User table in MySQL, and it contains the following:
+-------------------+-------------+------------------------------+
| Host | User | Password |
+-------------------+-------------+------------------------------+
| localhost | drupal | ************************ |
| 192.168.0.20 | drupal | ************************ |
+-------------------+-------------+------------------------------+
So, the drupal user *should* be able to connect from my workstation
(192.168.0.20). I am able to connect just fine directly from the server, but
not from my workstation. If it helps, here's the command I used to grant
access from within MySQL:
grant all privileges on devo2s.* to [EMAIL PROTECTED] identified by "mypas";
flush privileges;
Running this script from the MySQL server causes connection problems on the
PostgreSQL side (there are three computers involved here - my workstation,
the main server, and the *old* database server. The database is being moved
to the main server.). I know I can try to fix the PG connection problem, but
that doesn't seem tooo helpful if I can't connect to the MySQL server. I
just need to get past this connection issue and focus on the actual migration
code...
I've either missed something stupid, or there's a lower level problem and I
need a nudge in the right direction.
Either that, or if anyone can show me an EASY way to migrate a PostgreSQL
table to MySQL?
Thanks for any tips.
Shawn
pgph6ZjdMpdO3.pgp
Description: PGP signature
_______________________________________________ clug-talk mailing list [email protected] http://clug.ca/mailman/listinfo/clug-talk_clug.ca Mailing List Guidelines (http://clug.ca/ml_guidelines.php) **Please remove these lines when replying

