PHP & MySQL Tutorial
- How to Install phpMyAdmin on Windows
bogotobogo.com site search:
On phpMyAdmin
phpMyAdmin allows us to control MySQL server from a web browser. Installing phpMyAdmin is a quick process and once installed, we can create databases, tables, mysql users, as well as setting privileges for mysql users for particular tables or databases.
Web Server
Before installing phpMyAdmin, we should have already installed a webserver such as Apache or IIS.
Download phpMyAdmin
- We can download phpMyAdmin from Bringing MySQL to the web.
- Unpack the downloaded file to webserver Document root. For example, if our webserver is Apache, we may want to unpack file the file like so: phpMyAdmin-*.zip under htdocs\.
- If we are using Apache, we might do this: htdocs\phpMyAdmin-* to htdocs\phpMyAdmin.
phpMyAdmin
Type in http://localhost/phpMyAdmin/ into the URL, then we should see this:
config.inc.php
- Rename htdocs\phpMyAdmin\config.sample.inc.php to config.inc.php
- There are a number of authentication methods we may want to choose depending on our specific needs. This can be set in config.inc.php using $cfg['Servers'][$i]['auth_type']. For a personal server running behind a firewall, config may be desirable whereas a multi-user facility (such as an ISP) will want to use cookie or http.
- For a single-user (root or trusted) environment (This is my case), update config.inc.php as:
/* * Servers configuration */ $i = 0; /* * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'root_password'; $cfg['Servers'][$i]['auth_type'] = 'config';
If we type in http://localhost/phpmyadmin into the browser, we can bypass login sesstion and go directly into myadmin:
- For a multiuser (untrusted) environment, update config.inc.php as:
$cfg['Servers'][$i]['auth_type'] ='http'; $cfg['Servers'][$i]['user'] = ''; $cfg['Servers'][$i]['password'] = ''; $cfg['Servers'][$i]['controluser] = 'pma'; $cfg['Servers'][$i]['controlpass'] = 'pmapass';
- If we have edited config.inc.php for Muti-User(untrusted) environment then go to mysql command prompt and perform the following steps to create mysql user - 'pma' identfied by pass 'pmapass'.
C:\...\mysql\bin>mysql -u -root -p mysql>GRANT USAGE ON mysql.* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass'; mysql>GRANT SELECT ON mysql.db TO 'pma'@'localhost'; mysql>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, Shut_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'; mysql>GRANT SELECT (Host,Db, User,Table_name, Table_priv, Column_priv) ON mysql.tables_priv TO 'pma'@'locahost'; mysql>quit;
Ph.D. / Golden Gate Ave, San Francisco / Seoul National Univ / Carnegie Mellon / UC Berkeley / DevOps / Deep Learning / Visualization