phpMyAdmin Designer

Flashback to 1997. phpMyAdmin with the Designer view gives us an Access-ish design space with InnoDB-supported foreign keys, whee! For some stupid reason it’s a little tricky to set this up – you have to set up a special phpmyadmin database to track the extra layout information, and then configure phpMyAdmin to use it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<span class="pln">mysql </span><span class="pun">-</span><span class="pln">p </span><span class="pun"><</span><span class="pln"> </span><span class="str">/var/</span><span class="pln">www</span><span class="pun">/</span><span class="pln">localhost</span><span class="pun">/</span><span class="pln">htdocs</span><span class="pun">/</span><span class="pln">phpmyadmin</span><span class="pun">/</span><span class="pln">scripts</span><span class="pun">/</span><span class="pln">create_tables_mysql_4_1_2</span><span class="pun">+.</span><span class="pln">sql
mysql </span><span class="pun">-</span><span class="pln">p </span><span class="pun"><</span><span class="pln"> </span><span class="str">/var/</span><span class="pln">www</span><span class="pun">/</span><span class="pln">localhost</span><span class="pun">/</span><span class="pln">htdocs</span><span class="pun">/</span><span class="pln">phpmyadmin</span><span class="pun">/</span><span class="pln">scripts</span><span class="pun">/</span><span class="pln">upgrade_tables_mysql_4_1_2</span><span class="pun">+.</span><span class="pln">sql
emacs </span><span class="pun">/</span><span class="kwd">var</span><span class="pun">/</span><span class="pln">www</span><span class="pun">/</span><span class="pln">localhost</span><span class="pun">/</span><span class="pln">htdocs</span><span class="pun">/</span><span class="pln">phpmyadmin</span><span class="pun">/</span><span class="pln">config</span><span class="pun">.</span><span class="pln">inc</span><span class="pun">.</span><span class="pln">php
</span><span class="pun">--------</span><span class="pln">
</span><span class="com">/* MDM This was working with defaults (pma/pmapass) but anyone could guess that and access the db! */</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'controluser'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma'</span><span class="pun">;</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'controlpass'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'USEYEROWNPASSWORDHEREYASCRUB'</span><span class="pun">;</span><span class="pln">
 
</span><span class="com">/* MDM Added to prevent warnings on table operations tab.  These are all default values, not really needed.
Without these, you can still get to the "designer" tab: select database, click "designer" tab
and the "relation" page: select database, select table, select structure tab, select relation link */</span><span class="pln">
 
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'pmadb'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'phpmyadmin'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// Database used for Relation, Bookmark and PDF Features</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'bookmarktable'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_bookmark'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// Bookmark table</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'relation'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_relation'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to describe the relation between links (see doc)</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'table_info'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_table_info'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to describe the display fields</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'table_coords'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_table_coords'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to describe the tables position for the PDF schema</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'pdf_pages'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_pdf_pages'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to describe pages of relationpdf</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'column_info'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_column_info'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to store column information</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'history'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_history'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to store SQL history</span><span class="pln">
$cfg</span><span class="pun">[</span><span class="str">'Servers'</span><span class="pun">][</span><span class="pln">$i</span><span class="pun">][</span><span class="str">'designer_coords'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> </span><span class="str">'pma_designer_coords'</span><span class="pun">;</span><span class="pln"> </span><span class="com">// table to store the coordinates for Designer</span><span class="pln">
</span><span class="pun">--------</span><span class="pln">
</span><span class="kwd">then</span><span class="pln"> create the pma mysql user </span><span class="kwd">and</span><span class="pln"> grant it access to the phpmyadmin database </span><span class="kwd">using</span><span class="pln"> your own password</span><span class="pun">.</span><span class="pln">
</span><span class="kwd">then</span><span class="pln"> create some tables </span><span class="pun">-</span><span class="pln"> make sure you </span><span class="kwd">set</span><span class="pln"> them to </span><span class="kwd">use</span><span class="pln"> the </span><span class="typ">InnoDB</span><span class="pln"> engine </span><span class="pun">-</span><span class="pln"> </span><span class="kwd">and</span><span class="pln"> have some fun</span><span class="pun">!</span>

Whee!

Leave a Reply