Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable phpMyAdmin's Designer view?

I am running phpMyAdmin locally and I am trying to enable the Designer tool.

Screenshot of phpMyAdmin's Designer view

How do you enable designer view for phpMyAdmin?

I have read quite a few tutorials on how to enable the Designer view for phpMyAdmin and they all have different directions that never seem to actually get it working.

I am using version 4.0.7

like image 761
Carrie Kendall Avatar asked Oct 03 '13 18:10

Carrie Kendall


People also ask

How do I open relational view in phpMyAdmin?

Open phpMyAdmin and go to the Import tab. Click the browse button and find the create_tables. sql file and then click Go. The tables required for Relation view will be added to the database you specified.


2 Answers

The following steps will enable the Designer in phpMyAdmin 4+ assuming that phpMyAdmin is inside the folder phpMyAdmin:

  • Open phpMyAdmin/config.inc.php and phpMyAdmin/config.sample.inc.php.
  • Locate the phpMyAdmin configuration storage settings in config.sample.inc.php (lines 38-66 in 4.0.7).
  • Copy all of the control user and storage db/table config and paste it into config.inc.php. When you get done, your config.inc.php should include something like this:

4.0.7 Example:

/* change this info to whatever user has read-only access to the "mysql/user" and "mysql/db" tables */           $cfg['Servers'][$i]['controluser']   = 'root'; //this is the default user for MAMP's mysql $cfg['Servers'][$i]['controlpass']   = 'root'; //this is the default password for MAMP's mysql  /* this information needs to line up with the database we're about to create so don't edit it unless you plan on editing the SQL we're about to run */ $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';   $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; $cfg['Servers'][$i]['relation'] = 'pma__relation'; $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; $cfg['Servers'][$i]['history'] = 'pma__history'; $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords'; $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; 

Note: We are just telling phpMyAdmin what database and table names to store specific configuration details at. Now let's add the database.

  • phpMyAdmin installs with the SQL we need to generate the database that the Designer relies on. We just need to locate the script. In 4.0.7 the file location is phpMyAdmin/examples/create_tables.sql. Alternatively, you can copy/download this from phpMyAdmin's github.
  • Once you locate the file, either import the file or copy/paste it into a SQL window and execute in phpMyAdmin.
  • Now, everything should be configured properly. We need to clear cookies and restart the browser.
  • When you open phpMyAdmin back up, navigate to a specific table and in the tabs you should see Designer tab.

Disclaimer: These directions are specifically based on the new folder structure in phpMyAdmin 4+. You can apply the same directions by using phpMyAdmin's github config.sample.php and the accompanying create-table.sql. Choose your phpMyAdmin version by selecting the correct branch.

like image 85
Carrie Kendall Avatar answered Sep 24 '22 17:09

Carrie Kendall


It can be confusing, if you just follow the other answer. Yes, you need to change the configuration as explained, but this configuration refers to a MySQL user with special privileges. This is explained here: https://wiki.phpmyadmin.net/pma/controluser under the section about pmadb features. Therefore, there are two steps: (copy-pasting from the linked page)

  1. In mysql:

    GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';

  2. In ./config.inc.php:

    $cfg['Servers'][$i]['controluser'] = 'pma'; //Use here whatever username was created above $cfg['Servers'][$i]['controlpass'] = 'pmapass'; //use here the password to match that user

like image 21
ben26941 Avatar answered Sep 24 '22 17:09

ben26941