About 9,500,000 results
Open links in new tab
  1. command line - How to run SQL script in MySQL? - Stack Overflow

    Jan 20, 2012 · From Workbench: File > Run SQL Script -- then follow prompts From Windows Command Line: Option 1: mysql -u usr -p mysql> source file_path.sql Option 2: mysql -u usr …

  2. How to execute a MySQL command from a shell script?

    How can I execute an SQL command through a shell script so that I can make it automated? I want to restore data I have collected in a SQL file using a shell script.

  3. Pass parameters to MySQL script - Stack Overflow

    Dec 31, 2012 · I have a MySQL script file named query1.sql which contains: select * FROM $(tblName) LIMIT 10; I am in MySQL console, how do I pass the parameter to the script? This …

  4. How to execute a SQL file using MySQL command line tool?

    Jan 16, 2013 · 14 if you want to execute through command line mysql -u user -p < file.sql and if you want to execute once logged in to mysql database. use any of the below commands.

  5. sql - How to declare a variable in MySQL? - Stack Overflow

    Aug 1, 2012 · How to declare a variable in mysql, so that my second query can use it? I would like to write something like: SET start = 1; SET finish = 10; SELECT * FROM places WHERE place …

  6. How to generate the whole database script in MySQL Workbench?

    Dec 29, 2015 · How to generate SQL scripts for your database in Workbench In Workbench Central (the default "Home" tab) connect to your MySQL instance, opening a SQL Editor tab. …

  7. sql - MySQL Include a script within script - Stack Overflow

    Oct 8, 2012 · But remember "source" is not one of the many mysql-specific extensions to the sql language. It's a client-command, not a sql statement, Why do you care? If you're sending your …

  8. mysql - How to echo print statements while executing a sql script ...

    May 22, 2016 · 58 We have a simple sql script which needs to be executed against a MySQL database and we would like print log statements on the progress of the script (e.g. Inserted 10 …

  9. How to run script from within Mysql workbench? - Stack Overflow

    I have a SQL script to distribute to others to run from a MySQL IDE, not from a MySQL command prompt. I want the user to load the script into a window of workbench (or another IDE like …

  10. How do I pass a variable to a mysql script? - Stack Overflow

    mysql> source script.sql How do I pass a variable to the script? For example, if I want to run a script that retrieves all the employees in a department, I want to be able to pass in the number …