{"id":551,"date":"2012-08-03T20:21:54","date_gmt":"2012-08-03T19:21:54","guid":{"rendered":"http:\/\/ineedwebhosting.uk\/blog\/?p=551"},"modified":"2023-01-03T14:19:36","modified_gmt":"2023-01-03T13:19:36","slug":"mysql-upgrade-from-mysql-5-1-to-mysql-5-5","status":"publish","type":"post","link":"https:\/\/ineedwebhosting.uk\/blog\/mysql-upgrade-from-mysql-5-1-to-mysql-5-5\/","title":{"rendered":"MySQL upgrade from MySQL 5.1 to MySQL 5.5"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">As part of maintaining the latest software helping security and performance an MySQL upgrade is planned from version 5.1.57 to 5.5.25a. The upgrade will take place over the next few weeks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below is a brief summary of the MySQL changes. The full documentation can be read here:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/upgrading-from-previous-series.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/upgrading-from-previous-series.html<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is expected that there will be less than 0.1% of websites will be effected by these changes. Any possible problems are existing issues that will cause an error to occur where before the error was dropped silently.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The following is an overview of potential errors and how they could effect you.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Changes to TIMESTAMP<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is the support for display width, any SQL containing \u201cTIMESTAMP(N)\u201d will now cause an error. In previous versions this was silently ignored and then deprecated, this is now a syntax error. Below are 2 examples:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example on v5.5 (raises error 1064)<\/strong><br><code>mysql&gt; create table `table1` (ts TIMESTAMP);<br>\nQuery OK, 0 rows affected (0.13 sec)<br>\nmysql&gt; create table `table2` (ts TIMESTAMP(2));<br>\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(2))' at line 1<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Example on v5.1 (silently ignored)<\/strong><br><code>mysql&gt; create table `table1` (ts TIMESTAMP);<br>\nQuery OK, 0 rows affected (0.03 sec)<br>\nmysql&gt; create table `table2` (ts TIMESTAMP(2));<br>\nQuery OK, 0 rows affected, 1 warning (0.31 sec)<br>\nmysql&gt; show create table `table2`\\G<br>\n*************************** 1. row ***************************<br>\nTable: table2<br>\nCreate Table: CREATE TABLE `table2` (<br>\n`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP<br>\n) ENGINE=MyISAM DEFAULT CHARSET=latin1<br>\n1 row in set (0.00 sec)<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Changes to reserved words<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Any table\/column names and similar (eg functions\/triggers) should always be quoted with backticks (`), this has been the case for many years. If you have a table or column name that matches a reserved word you may get unexpected behavior if not quoted with backticks. It is recommended to check the following page for any new reserved words: <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/reserved-words.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/reserved-words.html<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">CREATE TABLE IF NOT EXISTS \u2026 SELECT<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The changes here are beyond the scope of this blog entry; you can see the full detailed changes here:<br><a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/create-table-select.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/create-table-select.html<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u201cout of range\u201d error (ER_DATA_OUT_OF_RANGE)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This error is now thrown if a numeric operation has a result that out of the range of the datatype being assigned to. Previous behavior was to silently enter NULL or an incorrect value. An example is given in their docs (<a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/out-of-range-and-overflow.html\">http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/out-of-range-and-overflow.html<\/a>), though be careful if you plan on relying on this behaviour.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Nested select statement<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Nested select statements are no longer supported with the SELECT \u2026 INTO syntax. For more information on this please see the official documentation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Aliases in DELETE statements<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">When using aliases in DELETE some syntax has been removed, you should check any DELETE statements that use table aliases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are receiving MySQL errors relating to any issues related to the MySQL upgrade, please get in touch with support. If you do not see any errors then you will not need to make any changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of maintaining the latest software helping security and performance an MySQL upgrade is planned from version 5.1.57 to 5.5.25a. The upgrade will take place over the next few weeks. Below is a brief summary of the MySQL changes. The full documentation can be read here: http:\/\/dev.mysql.com\/doc\/refman\/5.5\/en\/upgrading-from-previous-series.html It is expected that there will be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-web-hosting"],"_links":{"self":[{"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/comments?post=551"}],"version-history":[{"count":6,"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions"}],"predecessor-version":[{"id":1154,"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/posts\/551\/revisions\/1154"}],"wp:attachment":[{"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/media?parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/categories?post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ineedwebhosting.uk\/blog\/wp-json\/wp\/v2\/tags?post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}