Creating a MySQL database in memory with PHP PDO -


i'm coding library compare 2 mysql databases.

sources can sql string, sql file or mysql database connection.

use regular expressions parse tables/alter/indexes form sources terrible , lot of possible syntaxes.

i have script generate sql string source, , need import sql temporal database, launch describe table , parse text. lot of more easy , clean originals sources.

there way create memory/temporal mysql database php pdo without user , password credentials?

i have same script sqlite, allow create memory connections with:

$db1 = new pdo('sqlite::memory:');  $db1->exec($sql);  $tables = [];  foreach ($db1->query('.tables') $table) {     $q = $db1->prepare('.schema ?');     $q->execute([$table]);      $tables[$table] = $q->fetchall(); } 

there lot of more easy compare databases.

how can mysql?

thanks :)


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -