{"id":1290,"date":"2021-09-18T11:09:21","date_gmt":"2021-09-18T11:09:21","guid":{"rendered":"https:\/\/huzaifazoom.org\/?p=1290"},"modified":"2021-09-18T11:09:21","modified_gmt":"2021-09-18T11:09:21","slug":"mysql-data-for-production","status":"publish","type":"post","link":"https:\/\/observatory.huzaifazoom.org\/ar\/2021\/09\/18\/mysql-data-for-production\/","title":{"rendered":"2. MySQL Data for Production"},"content":{"rendered":"\n<h3>Shared MySQL instance<\/h3>\n\n\n<p>For the production <a href=\"https:\/\/huzaifazoom.org\/?p=337\" data-type=\"URL\" data-id=\"https:\/\/huzaifazoom.org\/?p=337\">Data View\/Download screen<\/a>, data is being fetched from a MySQL database. We are using the same MySQL instance that was installed as part of WordPress. The schema is different (jordanio). The creation and initialization of this database is a one-time process, so it is not covered here. What is given is the schema of the tables used as part of SQL CREATE statements. These commands need to be run within MySQL to create the database schema and tables for a new installation.<\/p>\n\n\n<pre class=\"wp-block-code\"><code>CREATE DATABASE IF NOT EXISTS jordanio CHARACTER SET \"utf8\";\nUSE jordanio;\nDROP TABLE IF EXISTS users;\nDROP TABLE IF EXISTS mva;\nDROP TABLE IF EXISTS indstat2;\nDROP TABLE IF EXISTS indstat4;\nCREATE TABLE mva (\n\tyear smallint NOT NULL,\n\tiso char(3) NOT NULL,\n\tvar varchar(7),\n\tvalue bigint NULL,\n\tPRIMARY KEY (year, iso, var)\n);\nCREATE TABLE indstat2 (\n\tyear smallint NOT NULL,\n\tiso char(3) NOT NULL,\n\tvar varchar(3),\n\tisic2 char(2),\n\tvalue bigint,\n\tPRIMARY KEY (year, iso, var, isic2)\n);\nCREATE TABLE indstat4 (\n\tyear smallint NOT NULL,\n\tiso char(3) NOT NULL,\n\tvar varchar(3),\n\tisic4 char(4),\n\tvalue bigint,\n\tPRIMARY KEY (year, iso, var, isic4)\n);\nCREATE TABLE indstat4_4 (\n\tyear smallint NOT NULL,\n\tiso char(3) NOT NULL,\n\tvar varchar(3),\n\tisic4 char(4),\n\tvalue bigint,\n\tPRIMARY KEY (year, iso, var, isic4)\n);\nCREATE TABLE users (\n\tuserid varchar(20) NOT NULL DEFAULT \"\",\n\tfullname varchar(60) DEFAULT NULL,\n\tpassword varchar(8) DEFAULT NULL,\n\tuserlvl smallint(6) DEFAULT NULL,\n\tPRIMARY KEY (`userid`)\n);\nCREATE USER jordanio IDENTIFIED BY 'jordaniopwd';\nGRANT ALL PRIVILEGES ON jordanio.* TO jordanio;<\/code><\/pre>\n\n\n<p>Once the schema and tables are created, the simplest way to initialize the tables is to run the administrator <a href=\"https:\/\/huzaifazoom.org\/?page_id=1027\">Data Update<\/a> operation for UNIDO data (UN Comtrade data is already part of the jordan.zip file, so it does not need to be initialized; the update operation can be run later to bring the trade data up to date).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shared MySQL instance For the production Data View\/Download screen, data is being fetched from a MySQL database. We are using the same MySQL instance that was installed as part of WordPress. The schema is different (jordanio). The creation and initialization of this database is a one-time process, so it is not covered here. What is &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/observatory.huzaifazoom.org\/ar\/2021\/09\/18\/mysql-data-for-production\/\"> <span class=\"screen-reader-text\">2. MySQL Data for Production<\/span> \u0642\u0631\u0627\u0621\u0629 \u0627\u0644\u0645\u0632\u064a\u062f &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[15],"tags":[],"_links":{"self":[{"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/posts\/1290"}],"collection":[{"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/comments?post=1290"}],"version-history":[{"count":0,"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/posts\/1290\/revisions"}],"wp:attachment":[{"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/media?parent=1290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/categories?post=1290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/observatory.huzaifazoom.org\/ar\/wp-json\/wp\/v2\/tags?post=1290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}