更新时间:2023-02-04 21:43:55
您可以使用 ddev import-db --target-db=newdb
直接导入其他数据库.创建的数据库已经有权限等
Youu can import additional databases directly with ddev import-db --target-db=newdb
. The created database will already have permissions, etc.
您还可以手动创建和管理数据库(尽管现在很少需要这样做了).数据库服务器的root密码是'root',所以你可以在里面mysql -uroot -proot
(或者使用ddev mysql -uroot -proot
).
You can also manually create and manage databases (although this is rarely necessary any more). The root password for the db server is 'root', so you can mysql -uroot -proot
in there (or use ddev mysql -uroot -proot
).
ddev mysql -uroot -proot
创建数据库新数据库;
GRANT ALL ON newdb.* to 'db'@'%' IDENTIFIED BY 'db';
ddev import-db --target-db=newdb --src=dumpfile.sql
有关数据库管理的更多详细信息,请访问 https://ddev.readthedocs.io/en/latest/users/topics/database_management/
More details about database management at https://ddev.readthedocs.io/en/latest/users/topics/database_management/