Replace MySQL with MemCP: Difference between revisions

From MemCP
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
[[File:Ports.svg|thumb]]
+
[[File:Ports.svg|thumb|none]]
[[File:MemCP Port.png|thumb]]
 
 
 
=== Connection to MemCP ===
 
=== Connection to MemCP ===
 
MemCP can be connected with any compatible MySQL connector:
 
MemCP can be connected with any compatible MySQL connector:

Revision as of 11:05, 31 October 2024

Ports.svg

Connection to MemCP

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

To import data from MySQL into MemCP, you have to perform two steps:

  1. sudo apt install python3-mysql.connector
  2. in memcp: ./mysqldump-to-json.py -h localhost -u USER -p PASSWORD database > dump.jsonl