Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. How do I create Database Script?

How do I create Database Script?

Scheduled Pinned Locked Moved Database
questiondatabasemysqlsysadmintools
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    graced88
    wrote on last edited by
    #1

    Hi, how can i create a database script? so that i dont have to copy paste my declarations of creating the database and tables from notepad. Im using MySQL Server 5.0 Thank you!

    W 1 Reply Last reply
    0
    • G graced88

      Hi, how can i create a database script? so that i dont have to copy paste my declarations of creating the database and tables from notepad. Im using MySQL Server 5.0 Thank you!

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      Can you simply save it as a text file and then use source command in mysql command line client?

      List of all MySQL commands:
      Note that all text commands must be first on line and end with ';'
      ? (\?) Synonym for `help'.
      clear (\c) Clear command.
      connect (\r) Reconnect to the server. Optional arguments are db and host.
      delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.
      ego (\G) Send command to mysql server, display result vertically.
      exit (\q) Exit mysql. Same as quit.
      go (\g) Send command to mysql server.
      help (\h) Display this help.
      notee (\t) Don't write into outfile.
      print (\p) Print current command.
      prompt (\R) Change your mysql prompt.
      quit (\q) Quit mysql.
      rehash (\#) Rebuild completion hash.
      source (\.) Execute an SQL script file. Takes a file name as an argument.
      status (\s) Get status information from the server.
      tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
      use (\u) Use another database. Takes database name as argument.
      charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
      warnings (\W) Show warnings after every statement.
      nowarning (\w) Don't show warnings after every statement.

      The need to optimize rises from a bad design. My articles[^]

      G 1 Reply Last reply
      0
      • W Wendelius

        Can you simply save it as a text file and then use source command in mysql command line client?

        List of all MySQL commands:
        Note that all text commands must be first on line and end with ';'
        ? (\?) Synonym for `help'.
        clear (\c) Clear command.
        connect (\r) Reconnect to the server. Optional arguments are db and host.
        delimiter (\d) Set statement delimiter. NOTE: Takes the rest of the line as new delimiter.
        ego (\G) Send command to mysql server, display result vertically.
        exit (\q) Exit mysql. Same as quit.
        go (\g) Send command to mysql server.
        help (\h) Display this help.
        notee (\t) Don't write into outfile.
        print (\p) Print current command.
        prompt (\R) Change your mysql prompt.
        quit (\q) Quit mysql.
        rehash (\#) Rebuild completion hash.
        source (\.) Execute an SQL script file. Takes a file name as an argument.
        status (\s) Get status information from the server.
        tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
        use (\u) Use another database. Takes database name as argument.
        charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
        warnings (\W) Show warnings after every statement.
        nowarning (\w) Don't show warnings after every statement.

        The need to optimize rises from a bad design. My articles[^]

        G Offline
        G Offline
        graced88
        wrote on last edited by
        #3

        really? so i can just save it as db.txt and inside it it will contain: create database myDatabase; use myDatabase; etc. etc.... then i will just type: source db.txt ? Thank you! ;)

        G 1 Reply Last reply
        0
        • G graced88

          really? so i can just save it as db.txt and inside it it will contain: create database myDatabase; use myDatabase; etc. etc.... then i will just type: source db.txt ? Thank you! ;)

          G Offline
          G Offline
          graced88
          wrote on last edited by
          #4

          IT WORKED! thank you! :)

          W 1 Reply Last reply
          0
          • G graced88

            IT WORKED! thank you! :)

            W Offline
            W Offline
            Wendelius
            wrote on last edited by
            #5

            You're welcome :)

            The need to optimize rises from a bad design. My articles[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups