Skip to content

Instantly share code, notes, and snippets.

@msanjaypandit
Last active December 20, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save msanjaypandit/939abcb8cd247be48a8bc3f6cb61ec54 to your computer and use it in GitHub Desktop.
Save msanjaypandit/939abcb8cd247be48a8bc3f6cb61ec54 to your computer and use it in GitHub Desktop.
[MySQL Queries] Mysql queries #mysql #query
  • Convert DateTime in UnixTimeStamp
    SELECT *,from_unixtime(date_added) FROM TABLE_NAME order by date_added desc

  • Space consume by a table
    SELECT table_schema "Data Base Name",sum( data_length + index_length ) / 1024 / 1024 /1024 "Used GB" FROM information_schema.TABLES GROUP BY table_schema ;

  • Character Set utf8mb4_unicode_ci

  • Set a login path using terminal/putty
    mysql_config_editor set --login-path=anyname --host=localhost --port=3306 --socket=/var/run/mysqld/mysqld.sock --user=databaseuser --password

  • How to fix a MySQL Failed to Start error
    Please visit LowendBox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment