'MySQL' Tag

  • Producing MySQL dates from Perl

    April 24, 2011

    Ever written the occasional Perl script and wanted to insert the current date and time into a MySQL database? Here is the function to do it. This works for a column of type ‘datetime’. 1 2 3 4 5 6 # function to return the current time in mysql format sub mysql_now() { my($sec,$min,$hour,$mday,$mon,$year,$wday, $yday,$isdst)=localtime(time); [...]

  • Altering the character set of a MySQL database

    August 12, 2010

    It happens often that I forget to change the default character set of a database to utf8 and so find out late in the development cycle that many of my fields are based on non utf8 character sets (mostly latin1). Then I go in and modify each field in turn using ALTER TABLE [table] MODIFY [...]

  • Producing MySQL dates on the command line

    July 21, 2010

    I often find myself in need of inserting data manually into a MySQL database using some kind of database editor. In a database editor you find yourself manually inserting values into cells of a table and in most of them you are not allowed to enter an SQL expression (the MySQL Query Browser is a [...]

 
Powered by Wordpress and MySQL. Theme by Mark Veltzer derived from Shlomi Noachs openark theme