Results 1 to 4 of 4
  1. #1
    Join Date
    May 2007
    Posts
    139

    Unanswered: is any way execute these statements at once localhost?

    I have a textbook in java/db:mysql/jsp that in code files have in databases chapter a file webhomecoverdb.ddl, with sql statements modify db/tables, wueries, update queries, organized one line each statement, well is any way execute these statements at once in localhost(jsp/mysql/windows)?

  2. #2
    Join Date
    Mar 2006
    Posts
    56
    Hi, lse.

    You can write all your SQL statements in a text file and feed the file to MySQL in a few ways:
    MySQL :: MySQL 5.1 Reference Manual :: 4.5.1.4 Executing SQL Statements from a Text File

  3. #3
    Join Date
    May 2007
    Posts
    139

    this mean the file must be text, but file extension does not matter?

    this mean the file must be text, but file extension does not matter?

  4. #4
    Join Date
    Sep 2009
    Location
    San Sebastian, Spain
    Posts
    880
    There are two ways of executing a file containing either passing in the file name at the command line:

    mysql < filename

    or if you are already in mysql using

    source filename

    the filename can have any type of extension but having a standard naming convention for your files helps later on understand what the file actually is used for. The typical standard is .sql
    Ronan Cashell
    Certified Oracle DBA/Certified MySQL Expert (DBA & Cluster DBA)
    http://www.it-iss.com
    Follow me on Twitter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •