Skip to content

Instantly share code, notes, and snippets.

@andresaquino
Forked from msanjaypandit/mysql-queries1.md
Created December 20, 2018 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andresaquino/c0bccf88ca817ba9decf320d1bc74ae4 to your computer and use it in GitHub Desktop.
Save andresaquino/c0bccf88ca817ba9decf320d1bc74ae4 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