PHPMyAdmin is a web-based open source tool written in PHP designed to help manage MySQL database through the Web browser. Because of this PhpMyAdmin facilitates the management and maintenance of the MySQL database. PhpMyAdmin provides an easy way to use graphic interface to write and execute queries, manage databases, tables, fields, relationships, indexes, users, privileges, to export and import data, etc. Depending on the user access level, using this server PHP script, you can manage both individual databases and the entire MySQL server. It should be noted that user does not need to know SQL commands and use them directly. Most web hosting providers use phpMyAdmin to access their clients to MySQL databases. In this article we will take a look on how to install phpMyAdmin on IIS on Windows 10 or Windows Server 2016.
How to Install phpMyAdmin on IIS?
In this article, we will show you how to install and configure phpMyAdmin on IIS (Internet Information Services) Web Server on Windows 10 or Windows Server 2016. It assumed that you have already configured IIS with PHP support and installed and run MySQL instance on your Windows device.
First of all you have to download the latest version of phpMyAdmin. You should download a file with all languages (the file name ends with *all-languages.7z or *all-languages.zip). For example—phpMyAdmin-4.8.3-all-languages.zip. File size is about 10 MB.
Extract the files from the archive to phpmyadmin folder (C:\inet\pub\www\root\phpmyadmin).
You can install the phpMyAdmin in the folder of the current IIS website, and create a separate site for it, we recommend the last option (IIS manager > Sites > Add Website > Specify site name and path to the phpmyadmin folder).
In general, we have completed the installation of phpMyAdmin. Now we should open a browser and make sure that we did installation correct. Go to the webpage http://localhost/phpmyadmin/ and you will see a window like this:
Now we have to configure phpMyAdmin. Before you connect to the SQL server, you should create a configuration file. This file can be created manually (simply use a text editor), but we will use another method (by using GUI). Visit http://localhost/phpmyadmin/setup/ in your browser.
During your first session you will see an error message:
Please create web server writable folder config in phpMyAdmin top level directory as described in documentation. Otherwise you will be only able to download or display it.
To solve this, problem you should create folder (C:\inet\pub\www\root\phpmyadmin\config). After that grant full access NTFS permissions for local group IIS_IUSRS and user IUSR.
Return to the phpMyAdmin config window. To configure the MySQL connection settings click on the “New Server” button.
Enter the verbose (user-friendly) name of the SQL server, and then specify your mySQL server hostname. If necessary, you can specify other settings.
Save the settings and then the PhpMyAdmin will redirect you to the previous page. Choose:
- the default language—English
- the default server—127.0.0.1
- end of the line—Windows ( r n)
Click Save, and then download the config file. The received file (config.inc.php) you should save to the root directory (C:\inet\pub\www\root\phpmyadmin).
Tip. You can use the PhpMyAdmin configuration file template (..phpMyAdminconfig.sample.inc.php) to create your own config.inc.php configuration file manually. Just rename config.sample.inc.php file to the config.inc.php and edit it.
Open the authorization window (http://localhost/phpmyadmin/) and login under root account (for authorization, use the credentials of your MySQL server). If you see the start phpMyAdmin page, you can delete the config folder.
PhpMyAdmin can store some of its settings, history, statistics, etc. in a separate MySQL database. Ready script file for creating database is stored in the directory PhpMyAdmin. To create a new config database on the main page click on the Import tab and then click on the Browse button. Select the C:\inet\pub\www\root\phpMyAdmin\examplescreate_tables.sql file and click Go.
Note. If create_tables.sql file is missing in the C:\inet\pub\www\root\phpMyAdmin\examples folder, then check if it is present in the following path—C:\inet\pub\www\root\phpMyAdmin\examples\create_tables.sql (as we understand this directory is used in phpMyAdmin-4.4.4 and newer).
If you did it correct, you should see a new database in the left section.
Also, for a proper work phpMyAdmin requires a dedicated MySQL account.
We recommend you to create account like this:
- User name: pma
- Host: localhost
- Password: sTr0ngPmapa$$
After that you should grant all database privileges to this new user.
Finally, using any text editor you have to uncomment (remove “//”) and edit the following lines in the phpMyAdmin config file (config.inc.php):
$cfg[‘Servers’][$i][‘controluser’] = ‘pma’; $cfg[‘Servers’][$i][‘controlpass’] = ‘sTr0ngPmapa$$’; $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]['tracking'] = 'pma_tracking';
Save the changes to the config.inc.php file.
And that’s it. We have completed to install phpMyAdmin on IIS web server running on Windows 10 and Windows Server 2016. Now you can proceed with the databases management.
If you encounter any issues or have any questions you may request that in the comment section below.