Migration from MySQL and PostgreSQL: Difference between revisions
Jump to navigation
Jump to search
(Created page with "thumb|none|640x640px ===Connection to MemCP via MySQL Connector=== MemCP can be connected with any compatible MySQL connector: $db = new \PDO<code>"mysql:host=localhost;port=3307;dbname=system", 'root', 'admin');</code> echo $db->query("SELECT 'it works'")->fetchColumn(); // outouts: it works ===Import data from MySQL and PostgreSQL=== To import data from MySQL into MemCP, you have to perform the following command in<code>memcp</code>console: (l...") |
(No difference)
|
Revision as of 20:15, 20 November 2024
Connection to MemCP via MySQL Connector
MemCP can be connected with any compatible MySQL connector:
$db = new \PDO"mysql:host=localhost;port=3307;dbname=system", 'root', 'admin');
echo $db->query("SELECT 'it works'")->fetchColumn();
// outouts: it works
Import data from MySQL and PostgreSQL
To import data from MySQL into MemCP, you have to perform the following command inmemcp
console:
(load_sql "database" (stream "dump.sql")) /* for PostgreSQL mode, use load_psql instead */
When the sqldump is zipped, use:
(load_sql "database" (gzip (stream "dump.sql"))) /* for PostgreSQL mode, use load_psql instead */
or:
(load_sql "database" (xz (stream "dump.sql"))) /* for PostgreSQL mode, use load_psql instead */
The dumps can be created with mysqldump
or pg_dump
.