开发者

Creating database with same structure but different name

开发者 https://www.devze.com 2023-02-21 11:28 出处:网络
i have a database with name \"DB_General\" i want to create separate data base for each u开发者_JAVA百科ser

i have a database with name "DB_General" i want to create separate data base for each u开发者_JAVA百科ser

according to his name like"DB_User1". i want to use the same structure for "DB_User1" as

given in "DB_General". is there any way to do this, i am using MySQL database in JSP.


make a backup of DB_General eg using mysqldump, remove data if needed and restore it under different database name like DB_User_1

however idea of creating separate database for each user seems to be far way from wise


Run the following programmatically from a shell:

mysqladmin --user=foo --password=bar create DB_User1

mysqldump --user=foo --password=bar --no-data DB_general | mysql --user=foo --password=bar DB_User1
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号