Install phpMyAdmin on 1and1
You can install your own instance of phpmyadmin on your 1and1 shared hosting package. The advantage of this approach is that you can share access to a single database with other users without having to give them credentials to access your 1and1 backend. To accomplish this, follow the procedure below:
- Download a copy of phpmyadmin.
- Unzip the contents of your new download.
- Create the directory you wish to host the phpmyadmin on your 1and1 webserver (eg. http://yourwebsite.com/phpMyAdmin/)
- Use the 1and1.com backend controls to password protect this phpmyadmin directory (found under Web Access>Protected Directories).
- Use the following code in your config.inc.php, but replace the database host, database username, database password and database name with the appropriate values:
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use scripts/setup.php
*
* All directives are explained in Documentation.html and on phpMyAdmin
* wiki <http://wiki.phpmyadmin.net>.
*
* @version $Id: config.sample.inc.php 12304 2009-03-24 12:56:58Z nijel $
*/
/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = ”; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
/*
* Servers configuration
*/
$i = 0;
/*
* First server
*/
$i++;
$cfg['PmaAbsoluteUri'] = ‘http://yourwebsite.com/phpMyAdmin/’;
$cfg['Servers'][$i]['host'] = ‘db_host’; // something like db909ds.perforanet.net
$cfg['Servers'][$i]['auth_type'] = ‘config’; // 1and1.com uses ‘config’ as opposed to ‘cookie’
$cfg['Servers'][$i]['user'] = ‘db_user’; // something like dbo909809
$cfg['Servers'][$i]['password'] = ‘db_pass’;
$cfg['Servers'][$i]['only_db'] = ‘db_name’; // something like db909809
/* Server parameters */
$cfg['Servers'][$i]['connect_type'] = ‘tcp’;
$cfg['Servers'][$i]['compress'] = false;
/* Select mysqli if your server has it */
$cfg['Servers'][$i]['extension'] = ‘mysql’;
/* User for advanced features */
// $cfg['Servers'][$i]['controluser'] = ‘pma’;
// $cfg['Servers'][$i]['controlpass'] = ‘pmapass’;
/* Advanced phpMyAdmin features */
// $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’;
/*
* End of servers configuration
*/
/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = ”;
$cfg['SaveDir'] = ”;
?>
And that is it. The only difference between this config.inc.php and the default config.sample.inc.php that comes with phpmyadmin are the following 6 lines:
$cfg['PmaAbsoluteUri'] = ‘http://yourwebsite.com/phpMyAdmin/’;
$cfg['Servers'][$i]['host'] = ‘db_host’; // something like db909ds.perforanet.net
$cfg['Servers'][$i]['auth_type'] = ‘config’; // 1and1.com uses ‘config’ as opposed to ‘cookie’
$cfg['Servers'][$i]['user'] = ‘db_user’; // something like dbo909809
$cfg['Servers'][$i]['password'] = ‘db_pass’;
$cfg['Servers'][$i]['only_db'] = ‘db_name’; // something like db909809
Thank you for this, John.
I’ve tried it but I still have a 2002 error when I connect. Any other suggestion?
Thanks.
franck
28 Aug 09 at 8:44 am