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

    Jan 20, 2012 · use the MySQL command line client: mysql -h hostname -u user database < path/to/test.sql; Install the MySQL GUI tools and open your SQL file, then execute it; Use …

  2. MySQL - How to run SQL file or script from the terminal

    Nov 2, 2021 · When you need to run a saved .sql file directly from the terminal, you can use the mysql command line client. You can run SQL scripts with or without opening a connection to …

  3. How to Execute an SQL File in MySQL - MySQL Tutorial

    First, open the Command Prompt on Windows or the Terminal on macOS or Linux. Second, run the following command: In this command, you replace the username with your MySQL …

  4. How To Use MySQL From The Command Line [With Examples]

    Apr 1, 2025 · Once the MySQL shell is installed, follow the steps below to connect client against a given user login: #1) Open the shell/terminal in Mac/Linux (or command prompt in Windows)

  5. Executing an SQL Script From the Command Line - Baeldung

    Apr 20, 2024 · In this article, we discussed how to execute a .sql script for MySQL from the Bash command line. First, we looked at the steps to connect to a MySQL server and also explored …

  6. 6.5.1 mysql — The MySQL Command-Line Client

    You can execute SQL statements in a script file (batch file) like this: mysql db_name < script.sql > output.tab. On Unix, the mysql client logs statements executed interactively to a history file. …

  7. How to Run a SQL Script in MySQL from the Terminal

    Dec 27, 2023 · In this comprehensive guide, you‘ll learn how to run SQL script files in MySQL directly from a Linux terminal. We‘ll cover: Connecting to MySQL and running basic scripts; …

  8. Run SQL File in MySQL Database from Terminal - Online …

    Learn how to run an SQL file in a MySQL database from the terminal with this easy-to-follow guide.

  9. mysql - Mastering SQL Script Execution: A Deep Dive - command …

    Apr 26, 2025 · Open a terminal window. Use the cd command to change directories. The exact path will vary based on your installation. For example, on Windows, you might use: Replace …

  10. MySQL: Run Query from Bash Script or Linux Command Line

    Dec 27, 2016 · How to connect to MySQL database and run SQL query from the Linux command-line (execute query from shell) or Bash script.

  11. Some results have been removed
Refresh