Now, we can certainly all tough things out and do things at the command-line. And who doesn't just love to use vi? But believe it or not there are people out there who prefer to use more of a point and click method for doing things. And one of the most unanswered things out there is how to actually get up and running with phpMyAdmin for configuring your MySQL databases.
To begin with, I don't think it really matters what version of phpMyAdmin you might be trying to use. I am currently using 2.11.7, but will switch to the latest version, 3.1.1, for the purposes of this article. When you first decompress the archive into your /Library/WebServer/Documents/ folder, it will have a long name that includes the version. You'll normally want to shorten this to the following /Library/WebServer/Documents/phpMyAdmin/. Again, I'm going to leave mine long for illustration sake.
When you unpack the folder into your document root, you'll be greeted by a not so warm message.
The reason for this message #1045 is quite simple, nothing is really configured yet. For example, let's take a look at the configuration file for phpMyAdmin, config.inc.php. You'll have to 'cp config.sample.inc.php config.inc.php' to make things work right.
-
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
-
-
/*
-
* Servers configuration
-
*/
-
$i = 0;
-
-
/*
-
* First server
-
*/
-
$i++;
-
/* Authentication type */
-
$cfg['Servers'][$i]['auth_type'] = 'cookie';
-
/* Server parameters */
-
$cfg['Servers'][$i]['host'] = 'localhost';
-
$cfg['Servers'][$i]['connect_type'] = 'tcp';
-
$cfg['Servers'][$i]['compress'] = false;
-
/* Select mysqli if your server has it */
-
$cfg['Servers'][$i]['extension'] = 'mysql';
-
-
/* rajk - for blobstreaming */
-
$cfg['Servers'][$i]['bs_garbage_threshold'] = 50;
-
$cfg['Servers'][$i]['bs_repository_threshold'] = '32M';
-
$cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600;
-
$cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M';
-
-
/* 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';
-
/* Contrib / Swekey authentication */
-
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
In the configuration file, you'll see a couple of things. First of all, there is an entry for a blowfish-secret. This setting corresponds to the following line:
-
$cfg['Servers'][$i]['auth_type'] = 'cookie';
By setting the permissions for cookie based operation, we'll be prompted with a username and password each time we log in. You'll need to populate the blowfish-security value with some value for things to work, e.g., 0123456789. If you prefer to avoid doing this and simply want to go directly into the admin panel, you can make the following changes:
-
$cfg['Servers'][$i]['auth_type'] = 'cookie'; //change this to
-
$cfg['Servers'][$i]['auth_type'] = 'config';
-
$cfg['Servers'][$i]['user'] = 'root'; // add this line for root user
-
$cfg['Servers'][$i]['password'] = 'root password for mysql'; // add this password line for root user
Once you've done this, you're going to need to add the proper passwords for MySQL's root user. I've discussed this in my last article, but for simplicity, here it is again (you'll have to enter the interactive mysql shell by typing 'mysql -u root'):
-
SET password for root@localhost = password('yourpassword');
-
SET password for root@127.0.0.1 = password('yourpassword');
-
SET password for 'root'@'hostname.local' = password('yourpassword');
-
quit
Try to make sure your root password for MySQL actually matches your root password in your config.inc.php, otherwise things won't work-- duh! That's pretty much it. Go ahead and test things out, but it should work fine now.

One Comment on "phpMyAdmin not working properly on your Mac?"
Trackbacks
[...] here: phpMyAdmin not working properly on your Mac? Related ArticlesBookmarksTags ...