2016-07-28 65 views
0

我在尋找等價的:你如何用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 

在MySQL社區服務器5.7.4。

回答

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

如何

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

我不知道在哪裏指定數據的存儲位置。 – daxim