Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Mysql command line

Options
  • 10-11-2014 10:18pm
    #1
    Closed Accounts Posts: 1,040 ✭✭✭


    Hi, I am writing a report and i am wondering how can i copy a paste a table from mysql command line into a ms word document. I have seen an essay before where the table including dashed lines appear in a document.

    Thanks


Comments

  • Registered Users Posts: 159 ✭✭magooly




  • Registered Users Posts: 6,501 ✭✭✭daymobrew


    Or press Alt+Print Screen to copy the MySQL command line window to the clipboard and then paste it into your document.


  • Closed Accounts Posts: 3,357 ✭✭✭Beano




  • Closed Accounts Posts: 1,040 ✭✭✭Scrappychimow


    Beano wrote: »
    would this not do you?

    Thanks but i like the look of the original table.


  • Moderators, Society & Culture Moderators Posts: 17,642 Mod ✭✭✭✭Graham


    Which part are you struggling with, showing the table info or getting the table info into your document?

    From the MySQL command line, this will list all of the tables:
    show tables;
    

    To output the details for a specific table (probably goes without saying but replace TableNameHere with a real table name).
    desc TableNameHere;
    

    You will end up with something like this:
    +--------------+------------------+------+-----+-------------------+----------------+
    | Field        | Type             | Null | Key | Default           | Extra          |
    +--------------+------------------+------+-----+-------------------+----------------+
    | somestuff_id | int(10) unsigned | NO   | PRI | NULL              | auto_increment |
    | name         | varchar(50)      | NO   |     | NULL              |                |
    | value        | varchar(50)      | NO   |     | NULL              |                |
    | ts_updated   | timestamp        | YES  | MUL | CURRENT_TIMESTAMP |                |
    +--------------+------------------+------+-----+-------------------+----------------+
    4 rows in set (0.00 sec)
    

    Then use cut & paste as normal to transfer the output into your document.


  • Advertisement
  • Registered Users Posts: 6,150 ✭✭✭Talisman


    Are you looking for the text formatted output? If you want something cleaner then you could use MySQL for Excel provided you have Office 2007 or later and import the content to Excel. Transferring it from there to Word is a simple copy and paste.


  • Registered Users Posts: 2,342 ✭✭✭red_bairn


    Download Lightshot and take a screenshot of the table on the command line.


Advertisement