MariaDB:创建数据库并执行不带']的sql脚本>

问题描述 投票:0回答:1

我正在以各种方式尝试创建数据库并在命令行中使用sql脚本填充它。

mysql --user=root --password=hello --execute=create database test --source='accounts.sql'
-> starts to print help

mysql --user=root --password=hello --execute='create database test' --source='accounts.sql'
-> starts to print help

或唯一的数据库:

mysql --user=root --password=hello --execute=create database test
ERROR 1049 (42000): Unknown database 'test'

我将通过powershell对其进行管理,但在执行此操作之前,我想确保它可以从mariaDB命令行运行。 (Powershell无法识别'

是否可以创建db并从命令行填充它?谢谢大家

我正在以各种方式尝试创建数据库,并在命令行中使用sql脚本填充它。 mysql --user = root --password = hello --execute = create database test --source ='accounts.sql'-> ...

sql powershell command-line mariadb datasource
1个回答
0
投票

使用PowerShell打开和填充数据库的首选方法是首先跳转到mysql命令提示符:

© www.soinside.com 2019 - 2024. All rights reserved.