To backup your database -
mysqldump --user <mysql_username> --password=<mysql_password> <database> [<tablename>] > <output_filename>
To restore/initiate from the backup
mysql --user <db_username> --password=<db_password> <dbname> < <dump_file>
We used to stuck with many small issues in day-to-day coding. Again there can be small tips & tricks on how to get savvy, especially for less popular platforms like django & Ruby on Rails. The target of this blog is list the solutions & tips a developer found in his day-to-day coding.
mysqldump --user <mysql_username> --password=<mysql_password> <database> [<tablename>] > <output_filename>
mysql --user <db_username> --password=<db_password> <dbname> < <dump_file>
Time.now.strftime("%Y-%m-%d %H:%M:%S").to_s
now, it simplifies toTime.now.to_s(:db)
Detail documentation can be found hereTime.parse(token.created_at.to_s)
where created_at is DateTime type field in Token modelTime.now.to_i
and to read -Time.at(unix_timestamp)