Tuesday, 31 May 2016

How to Fix “Configuration of pmadb… not OK” in phpMyAdmin or phpmyadmin configuration storage is not completely.

To fix this you have to import/create the phpmyadmin database with it’s tables. An SQL script called create_tables.sql should be in the scripts, examples or sql folder of your phpMyAdmin installation.
To find out create_tables.sql run this below command

#find / -name create_tables.sql
Sample Output should be like this...
Go to create_table.sql directory
#mysql -u root -p < create_tables.sql  
Give your mysql root password ********
# mysql -u root –p
Give your mysql root password ********
>CREATE USER 'pma'@'localhost' IDENTIFIED BY 'pmapass';
>GRANT ALL PRIVILEGES ON `phpmyadmin`.* TO 'pma'@'localhost' WITH GRANT OPTION;

Now edit /etc/phpMyAdmin/config.inc.php and configure/uncomment those lines:

#vim /etc/phpMyAdmin/config.inc.php

 * phpMyAdmin configuration storage settings.

/* User used to manipulate with storage */
$cfg['Servers'][$i]['controlhost'] = 'localhost';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'pmapass';

/* 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]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';

Finally logout and login again to phpMyadmin.

Wednesday, 25 May 2016

MySql database administration in Linux

  • How to set MySQL Root password?
                 #mysqladmin -u root password YOURNEWPASSWORD
  • How to Change MySQL Root password?
                 #mysqladmin -u root -p oldpassword password 'newpassword'
  • How to check MySQL Server is running?
               # mysqladmin -u root -p ping
                 Enter password:
                 mysqld is alive

  • How to Check which MySQL version
               # mysqladmin -u root -p version

  • How to Find current Status of MySQL server?
               # mysqladmin -u root -ptmppassword status

  • How to check & see MySQL Server Variable’s and value’s?
               # mysqladmin -u root -p extended-status
               #mysqladmin  -u root -p variables

  • How to check all the running Process of MySQL server?
              # mysqladmin -u root -p processlist

  • How to create a Database?
               # mysqladmin -u root -p create databasename

  • How to delete a Database?
               # mysqladmin -u root -p drop databasename

  • How to reload/refresh MySQL Privileges?
               # mysqladmin -u root -p reload;
               # mysqladmin -u root -p refresh

  • How to shutdown MySQL server Safely?
               #mysqladmin -u root -p shutdown

MySQL Flush commands
  • flush-hosts: Flush all host information from host cache.
               # mysqladmin -u root -p flush-hosts

  • flush-tables: Flush all tables.
                # mysqladmin -u root -p flush-tables

  • flush-threads: Flush all threads cache.
                # mysqladmin -u root -p flush-threads

  • flush-logs: Flush all information logs.
                # mysqladmin -u root -p flush-logs

  • flush-privileges: Reload the grant tables (same as reload).
                # mysqladmin -u root -p flush-privileges

  • flush-status: Clear status variables.
                # mysqladmin -u root -p flush-status

  • How to Connect remote mysql server
                # mysqladmin  -h -u root –p

  • How to store MySQL server Debug Information to logs?
                # mysqladmin  -u root -p debug