2016-07-28 5 views
0

Ich suche das Äquivalent:Wie erstellt man eine Wegwerf-Datenbank mit mysql?

pg_ctl init -D ~/throw-away-database 
pg_ctl start -D ~/throw-away-database 
……… work work ……… 
pg_ctl stop -D ~/throw-away-database 
rm -rf ~/throw-away-database 

in MySQL Community Server 5.7.4.

Antwort

0
mysql_install_db --datadir=/tmp/foo 
mysqld_safe --datadir=/tmp/foo --socket=/tmp/foo/mysql.sock 
mysql -S /tmp/foo/mysql.sock -u root -p 
set password = password('xxxxxxxxxxxxxxxx'); 
……… work work ……… 
killall mysqld 
rm -rf /tmp/foo 
0

Wie wäre es

create schema my_throw_away001; -- creates a database synonym schema 
use my_throw_away001; -- set this as the current to use 

-- Do stuff like 

create table myTable 
( id int auto_increment primary key, 
    thing varchar(100) not null 
); 

insert myTable(thing) values ('frog'),('cat'); 

select * from myTable; 

-- Cleanup: 

drop schema my_throw_away001; -- drops database, poof gone 
+0

Ich sehe nicht, wo Sie angeben, wo die Daten gespeichert sind. – daxim

Verwandte Themen