4月 13, 2010
DBバックアップ(mysql,postgresql)
簡単なバックアップとリストアをメモします。。。
・mysqlバックアップ
[root@centos ~]# mysqldump -u root -p testdb > testdb.sql Enter password:
・mysqlリストア
[root@centos ~]# mysql -u root -p -B testdb < testdb.sql Enter password:
・postgresqlバックアップ
[root@centos ~]# pg_dump -U postgres testdb > testdb.sql
・postgresqlリストア
[root@centos ~]# psql -U postgres -d testdb < testdb.sql