Lonely Dreamer (sanmai) wrote,
Lonely Dreamer
sanmai

phpMyAdmin quick setup

Подчеркнуто то, что нужно изменить на своё.
~ $ mkdir -p www/htdocs www/logs; cd www/htdocs/
htdocs $ git clone git://github.com/phpmyadmin/phpmyadmin.git -b STABLE .
htdocs $ mysql -u root -p < examples/create_tables.sql
Затем,
htdocs $ mysql -u root -p 

GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass';
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';
htdocs $ cat config.inc.php 
<?php
$cfg['blowfish_secret'] = 'my blowfish secret';
// нужно если находимся за nginx
//$cfg['PmaAbsoluteUri'] = 'https://pma.example.com/';
// если нужно запретить подключения без SSL
//$cfg['ForceSSL'] = true;

$i = 1;
$cfg['Servers'][$i]['verbose'] = 'Server';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapass';
$cfg['Servers'][$i]['AllowNoPassword'] = false;

$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]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][$i]['recent'] = 'pma_recent';

/*
$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
        'allow example from all',
        'allow root from all',
);
*/

$cfg['ShowPhpInfo'] = true;

$cfg['SkipLockedTables'] = true;
$cfg['LoginCookieValidity'] = 14400;
$cfg['DefaultLang'] = 'english-utf-8';

$cfg['DefaultCharset'] = 'utf-8';
$cfg['FilterLanguages'] = '^(ru|en|ja)';

$cfg['AvailableCharsets'] = array(
    'utf-8',
);

$cfg['TitleTable'] = '@TABLE@ - @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@';
$cfg['TitleDatabase'] = '@VSERVER@ / @DATABASE@ | @PHPMYADMIN@';
$cfg['TitleServer'] = '@VSERVER@ | @PHPMYADMIN@';
$cfg['TitleDefault'] = '@PHPMYADMIN@';
$cfg['SQLQuery']['ShowAsPHP'] = false;
Проверяем автоматическое обновление:
htdocs $ crontab -l
@daily cd ~/www/htdocs/ && git pull -Xtheirs -q
Если ничего не выводит, значить нужно crontab -e и добавить эту строчку.

Cм. также:
https://pma.example.com apache vhost config
phpMyAdmin + SSL + nginx + apache2
Tags: linux, mysql, php, subversion, useful
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments