-1

I wrote a batch script that it creates a sql file for my database.

It will automatically write id and image file direction and idproduct but I don't know how to insert mysql code with using batch file to xampp phpmyadmin

JNevill
  • 46,980
  • 4
  • 38
  • 63
Mhwmd
  • 71
  • 8
  • You should be able to use the mysql command line tool. `mysql -u username -p password database_name < c:\full\path\to\file.sql` – Daniel Gale May 15 '18 at 19:41
  • 1
    `mysql` is the database. `phpmyadmin` is a web-based client for the database. `apache` is a web server. `php` is a server side scripting language. `xampp` bundles all of these together into one install/UI. You have a `sql` file that you want to connect to your `mysql` db and run against it. This has nothing to do with phpmyadmin, or xampp. You can use the `mysql.exe` to do command line operations (batch file) against your `mysql` database [like this](https://stackoverflow.com/questions/698914/how-can-i-access-the-mysql-command-line-with-xampp-for-windows) – JNevill May 15 '18 at 19:59
  • 2
    Possible duplicate of [How to import an SQL file using the command line in MySQL?](https://stackoverflow.com/questions/17666249/how-to-import-an-sql-file-using-the-command-line-in-mysql) – JNevill May 15 '18 at 20:01

1 Answers1

0

Simply use the MySQL.exe tool in your batch:

mysql -u username -p password database_name < "c:\path\to\SqLfile.sql"
Gerhard
  • 22,678
  • 7
  • 27
  • 43