如何通过创建批处理文件连接 PHPMyadmin DB
我已经创建了 sql 文件来在数据库中创建表。
我正在使用 PHPMYAdmin 但我无法连接到数据库。
我想将其作为批处理文件运行。
如果我尝试从命令提示符运行 MYSQL,则会出现错误,谨致
'mysql' is not recognized as an internal or external command,
operable program or batch file.
问候, 开发者
I have created the sql file to create table in DB.
I am using PHPMYAdmin But i am not able to connect to the DB.
I want to run this as Batch file.
If i try to MYSQL from command prompt it give error as
'mysql' is not recognized as an internal or external command,
operable program or batch file.
Regards,
Dev
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
phpMyAdmin 是一个交互式 Web 应用程序;它不是为批量执行而设计的。如果您想要一些可编写脚本的东西或者可以作为批处理文件运行的东西,您应该使用命令行客户端,甚至是脚本语言(Python、PHP、Ruby 等)的库函数。
该错误消息表明 MYSQL 程序不在您的路径中。一般来说,XAMPP 会为命令行客户端安装一个菜单项;尝试在程序菜单中查找它的快捷方式。您可能还可以轻松地在磁盘上的 XAMPP 文件夹中找到可执行文件,然后只需指定路径或将该目录添加到路径语句中即可。
phpMyAdmin is an interactive web application; it's not designed to be batch executed. If you want something scriptable or that you can run as a batch file, you should be using the command-line client or even the library functions of your scripting language (Python, PHP, Ruby, etc).
That error message indicates that the MYSQL program is not in your path. Generally XAMPP installs a menu item for the command-line client; try looking in your program menu for a shortcut for it. You'll probably also easily find the executable on disk in the XAMPP folder, then just need to specify the path or add that directory to your path statement.