Mudanças entre as edições de "Phpmyadmin"

De WikiLICC
Ir para: navegação, pesquisa
m (Importing the phpmyadmin database)
m (Reload the configuration)
 
(4 revisões intermediárias pelo mesmo usuário não estão sendo mostradas)
Linha 9: Linha 9:
 
==Creating the pma user account==
 
==Creating the pma user account==
  
phpMyAdmin requires a dedicated user account for the phpmyadmin database. You can call the account whatever you like, but these instructions use pma.
+
phpMyAdmin requires a dedicated user account for the phpmyadmin database.
 
+
* Click the Users tab  
* Click the Users tab at the top of the phpMyAdmin screen.
 
 
* Click Add user.
 
* Click Add user.
* Use the following values in Login Information:
+
* Use  
 
   User name: pma
 
   User name: pma
 
   Host: localhost
 
   Host: localhost
 
   Password: secret (choose your own password)
 
   Password: secret (choose your own password)
 
+
* Click Go to create the user account.
* Click Go at the bottom of the page to create the user account.
 
  
 
==Setting the permissions for the pma account==
 
==Setting the permissions for the pma account==
 
The permissions for the pma account are complicated, so it's easier to execute a series of SQL statements rather than use the phpMyAdmin interface to set them.
 
  
 
* Click the SQL tab at the top of the phpMyAdmin screen.
 
* Click the SQL tab at the top of the phpMyAdmin screen.
  
* Copy the following series of SQL queries, and paste them into the SQL field in phpMyAdmin. The queries assume you are using pma as the name of the user account. If you have chosen a different name, replace pma in each GRANT query with the name you're using.
+
* Copy the following series of SQL queries, and paste them into the SQL field in phpMyAdmin.  
 
 
 
     GRANT USAGE ON mysql.* TO 'pma'@'localhost';
 
     GRANT USAGE ON mysql.* TO 'pma'@'localhost';
 
     GRANT SELECT (
 
     GRANT SELECT (
Linha 42: Linha 37:
 
     GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
 
     GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
  
* Click Go to execute the queries. They can be executed simultaneously because each query ends with a semicolon. phpMyAdmin should report that MySQL returned an empty result.
+
* Click Go to execute the queries.
  
 
== Update the phpMyAdmin configuration file ==
 
== Update the phpMyAdmin configuration file ==
  
Before the advanced features can be used, you need to add the details of the pma user and the phpmyadmin database to the phpMyAdmin configuration file, config.inc.php.
+
Edit the file /etc/config.inc.php
 
 
* You can either edit the existing version of config.inc.php, which is in the main phpmyadmin folder (/Applications/MAMP/bin/phpMyAdmin), or copy the following script, and use it to replace config.inc.php.
 
  
 +
* adding or editing the following
 
     <?php
 
     <?php
    /*
+
 
    * This is needed for cookie based authentication to encrypt password in
 
    * cookie
 
    */
 
 
     $cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 
     $cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 
+
 
    /*
 
    * Servers configuration
 
    */
 
 
     $i = 0;
 
     $i = 0;
 
+
 
    /*
 
    * First server
 
    */
 
 
     $i++;
 
     $i++;
 
     /* Authentication type */
 
     /* Authentication type */
 
     $cfg['Servers'][$i]['auth_type'] = 'config';
 
     $cfg['Servers'][$i]['auth_type'] = 'config';
 
     $cfg['Servers'][$i]['user'] = 'root';
 
     $cfg['Servers'][$i]['user'] = 'root';
     $cfg['Servers'][$i]['password'] = 'root';
+
     $cfg['Servers'][$i]['password'] = 'root';                 //  <=======
 
     /* Server parameters */
 
     /* Server parameters */
 
     $cfg['Servers'][$i]['host'] = 'localhost';
 
     $cfg['Servers'][$i]['host'] = 'localhost';
Linha 77: Linha 62:
 
     $cfg['Servers'][$i]['extension'] = 'mysqli';
 
     $cfg['Servers'][$i]['extension'] = 'mysqli';
 
     $cfg['Servers'][$i]['AllowNoPassword'] = false;
 
     $cfg['Servers'][$i]['AllowNoPassword'] = false;
 
+
 
 
     /*
 
     /*
 
     * phpMyAdmin configuration storage settings.
 
     * phpMyAdmin configuration storage settings.
 
     */
 
     */
 
+
 
 
     /* User account for configuration storage */
 
     /* User account for configuration storage */
 
     $cfg['Servers'][$i]['controluser'] = 'pma';
 
     $cfg['Servers'][$i]['controluser'] = 'pma';
     $cfg['Servers'][$i]['controlpass'] = 'secret';
+
     $cfg['Servers'][$i]['controlpass'] = 'SENHA_DO_USER_pma';   //  <=======
 
+
 
 
     /* Storage database and tables */
 
     /* Storage database and tables */
 
     $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
 
     $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
Linha 103: Linha 88:
 
     $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
 
     $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
 
     $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
 
     $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
 
+
 
    /*
 
    * End of servers configuration
 
    */
 
 
 
 
 
 
     ?>
 
     ?>
 +
To enable Designer tab WHEN clicking a database,
 +
    $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
  
 
The preceding script uses the MAMP default root password for MySQL (root):
 
The preceding script uses the MAMP default root password for MySQL (root):
     $cfg['Servers'][$i]['password'] = 'root';
+
     $cfg['Servers'][$i]['password'] = 'SENHA_ROOT_DO_MYSQL';
  
 
It also uses secret as the password for the pma user account:
 
It also uses secret as the password for the pma user account:
     $cfg['Servers'][$i]['controlpass'] = 'secret';  
+
     $cfg['Servers'][$i]['controlpass'] = 'SENHA_DO USER_pma';
 
 
Change both values as appropriate.
 
 
 
* If you decide to edit the existing version of config.inc.php, you need to set the values for phpMyAdmin configuration storage settings as shown in the last two sections of the preceding script.
 
* If you're using MAMP Pro, you also need to make a copy of the updated config.inc.php, and use it to replace the version of config.inc.php located at /Library/Application Support/appsolute/MAMP PRO/phpmyadmin.
 
  
 
==Reload the configuration==
 
==Reload the configuration==
  
 
Before the changes take effect, you need to reload the MySQL privileges and the phpMyAdmin configuration. The simple way to do this is to stop MySQL and restart the server. Then close your browser, and relaunch phpMyAdmin. You should now have access to the advanced features of phpMyAdmin.
 
Before the changes take effect, you need to reload the MySQL privileges and the phpMyAdmin configuration. The simple way to do this is to stop MySQL and restart the server. Then close your browser, and relaunch phpMyAdmin. You should now have access to the advanced features of phpMyAdmin.
 +
 +
Maybe, clear the cache too.

Edição atual tal como às 01h50min de 13 de setembro de 2015

Para habilitar designer no phpmyadmin siga:

Importing the phpmyadmin database

  • Launch phpMyAdmin, make sure the home screen is selected, and click the Import tab.
  • Click the Browse and select /usr/share/phpMyAdmin/sql/create_tables.sql.

Creating the pma user account

phpMyAdmin requires a dedicated user account for the phpmyadmin database.

  • Click the Users tab
  • Click Add user.
  • Use
 User name: pma
 Host: localhost
 Password: secret (choose your own password)
  • Click Go to create the user account.

Setting the permissions for the pma account

  • Click the SQL tab at the top of the phpMyAdmin screen.
  • Copy the following series of SQL queries, and paste them into the SQL field in phpMyAdmin.
   GRANT USAGE ON mysql.* TO 'pma'@'localhost';
   GRANT SELECT (
   Host, User, Select_priv, Insert_priv, Update_priv, Delete_priv,
   Create_priv, Drop_priv, Reload_priv, Shutdown_priv, Process_priv,
   File_priv, Grant_priv, References_priv, Index_priv, Alter_priv,
   Show_db_priv, Super_priv, Create_tmp_table_priv, Lock_tables_priv,
   Execute_priv, Repl_slave_priv, Repl_client_priv
   ) ON mysql.user TO 'pma'@'localhost';
   GRANT SELECT ON mysql.db TO 'pma'@'localhost';
   GRANT SELECT ON mysql.host TO 'pma'@'localhost';
   GRANT SELECT (Host, Db, User, Table_name, Table_priv, Column_priv)
   ON mysql.tables_priv TO 'pma'@'localhost';
   GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost';
  • Click Go to execute the queries.

Update the phpMyAdmin configuration file

Edit the file /etc/config.inc.php

  • adding or editing the following
   <?php
 
   $cfg['blowfish_secret'] = 'a8b7c6d'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
 
   $i = 0;
 
   $i++;
   /* Authentication type */
   $cfg['Servers'][$i]['auth_type'] = 'config';
   $cfg['Servers'][$i]['user'] = 'root';
   $cfg['Servers'][$i]['password'] = 'root';                  //  <=======
   /* Server parameters */
   $cfg['Servers'][$i]['host'] = 'localhost';
   $cfg['Servers'][$i]['connect_type'] = 'tcp';
   $cfg['Servers'][$i]['compress'] = false;
   /* Select mysql if your server does not have mysqli */
   $cfg['Servers'][$i]['extension'] = 'mysqli';
   $cfg['Servers'][$i]['AllowNoPassword'] = false;
 
   /*
    * phpMyAdmin configuration storage settings.
    */
 
   /* User account for configuration storage */
   $cfg['Servers'][$i]['controluser'] = 'pma';
   $cfg['Servers'][$i]['controlpass'] = 'SENHA_DO_USER_pma';    //  <=======
 
   /* Storage database and tables */
   $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';
   $cfg['Servers'][$i]['recent'] = 'pma__recent';
   $cfg['Servers'][$i]['users'] = 'pma__users';
   $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
   $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
 
   ?>

To enable Designer tab WHEN clicking a database,

   $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';

The preceding script uses the MAMP default root password for MySQL (root):

   $cfg['Servers'][$i]['password'] = 'SENHA_ROOT_DO_MYSQL';

It also uses secret as the password for the pma user account:

   $cfg['Servers'][$i]['controlpass'] = 'SENHA_DO USER_pma';

Reload the configuration

Before the changes take effect, you need to reload the MySQL privileges and the phpMyAdmin configuration. The simple way to do this is to stop MySQL and restart the server. Then close your browser, and relaunch phpMyAdmin. You should now have access to the advanced features of phpMyAdmin.

Maybe, clear the cache too.