Entire Database (all tables):
mysqldump -u root databasename > dump.sql
mysql -u root databasename < dump.sql
One Table:
mysqldump -u root -p yourpass dbname tablename | mysql -u root -p pass secondDB
PHP:
Run PHP SELECT FROM SOURCE-DB TABLE and Run INSERT INTO Table IN TARGET-DB