· 8 years ago · Mar 04, 2018, 12:52 PM
1Installation
2
3 1. Quick Install
4 2. Setup script usage
5 3. phpMyAdmin configuration storage
6 4. Upgrading from an older version
7 5. Using authentication modes
8
9phpMyAdmin does not apply any special security methods to the MySQL database
10server. It is still the system administrator's job to grant permissions on the
11MySQL databases properly. phpMyAdmin's "Privileges" page can be used for this.
12
13Warning for Mac users:
14if you are on a Mac OS version before OS X, StuffIt unstuffs with Mac formats.
15So you'll have to resave as in BBEdit to Unix style ALL phpMyAdmin scripts
16before uploading them to your server, as PHP seems not to like Mac-style end of
17lines character ("\r").
18
19Quick Install
20
21 1. Choose an appropriate distribution kit from the phpmyadmin.net Downloads
22 page. Some kits contain only the English messages, others contain all
23 languages in UTF-8 format (this should be fine in most situations), others
24 contain all languages and all character sets. We'll assume you chose a kit
25 whose name looks like phpMyAdmin-x.x.x-all-languages.tar.gz.
26 2. Untar or unzip the distribution (be sure to unzip the subdirectories): tar
27 -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz in your webserver's document
28 root. If you don't have direct access to your document root, put the files
29 in a directory on your local machine, and, after step 4, transfer the
30 directory on your web server using, for example, ftp.
31 3. Ensure that all the scripts have the appropriate owner (if PHP is running
32 in safe mode, having some scripts with an owner different from the owner of
33 other scripts will be a problem). See FAQ 4.2 and FAQ 1.26 for suggestions.
34 4. Now you must configure your installation. There are two methods that can be
35 used. Traditionally, users have hand-edited a copy of config.inc.php, but
36 now a wizard-style setup script is provided for those who prefer a
37 graphical installation. Creating a config.inc.php is still a quick way to
38 get started and needed for some advanced features.
39 + To manually create the file, simply use your text editor to create the
40 file config.inc.php (you can copy config.sample.inc.php to get minimal
41 configuration file) in the main (top-level) phpMyAdmin directory (the
42 one that contains index.php). phpMyAdmin first loads libraries/
43 config.default.php and then overrides those values with anything found
44 in config.inc.php. If the default value is okay for a particular
45 setting, there is no need to include it in config.inc.php. You'll need
46 a few directives to get going, a simple configuration may look like
47 this:
48
49 <?php
50 $cfg['blowfish_secret'] = 'ba17c1ec07d65003'; // use here a value of your choice
51
52 $i=0;
53 $i++;
54 $cfg['Servers'][$i]['auth_type'] = 'cookie';
55 ?>
56
57 Or, if you prefer to not be prompted every time you log in:
58
59 <?php
60
61 $i=0;
62 $i++;
63 $cfg['Servers'][$i]['user'] = 'root';
64 $cfg['Servers'][$i]['password'] = 'cbb74bc'; // use here your password
65 $cfg['Servers'][$i]['auth_type'] = 'config';
66 ?>
67
68 For a full explanation of possible configuration values, see the
69 Configuration Section of this document.
70 + Instead of manually editing config.inc.php, you can use the Setup
71 Script. First you must manually create a folder config in the
72 phpMyAdmin directory. This is a security measure. On a Linux/Unix
73 system you can use the following commands:
74
75 cd phpMyAdmin
76 mkdir config # create directory for saving
77 chmod o+rw config # give it world writable permissions
78
79 And to edit an existing configuration, copy it over first:
80
81 cp config.inc.php config/ # copy current configuration for editing
82 chmod o+w config/config.inc.php # give it world writable permissions
83
84 On other platforms, simply create the folder and ensure that your web
85 server has read and write access to it. FAQ 1.26 can help with this.
86
87 Next, open setup/ in your browser. Note that changes are not saved to
88 disk until explicitly choose Save from the Configuration area of the
89 screen. Normally the script saves the new config.inc.php to the config/
90 directory, but if the webserver does not have the proper permissions
91 you may see the error "Cannot load or save configuration." Ensure that
92 the config/ directory exists and has the proper permissions - or use
93 the Download link to save the config file locally and upload (via FTP
94 or some similar means) to the proper location.
95
96 Once the file has been saved, it must be moved out of the config/
97 directory and the permissions must be reset, again as a security
98 measure:
99
100 mv config/config.inc.php . # move file to current directory
101 chmod o-rw config.inc.php # remove world read and write permissions
102 rm -rf config # remove not needed directory
103
104 Now the file is ready to be used. You can choose to review or edit the
105 file with your favorite editor, if you prefer to set some advanced
106 options which the setup script does not provide.
107 5. If you are using the auth_type "config", it is suggested that you protect
108 the phpMyAdmin installation directory because using config does not require
109 a user to enter a password to access the phpMyAdmin installation. Use of an
110 alternate authentication method is recommended, for example with HTTP?AUTH
111 in a .htaccess file or switch to using auth_type cookie or http. See the
112 multi?user sub?section of this FAQ for additional information, especially
113 FAQ 4.4.
114 6. Open the main phpMyAdmin directory in your browser. phpMyAdmin should now
115 display a welcome screen and your databases, or a login dialog if using
116 HTTP or cookie authentication mode.
117 7. You should deny access to the ./libraries and ./setup/lib subfolders in
118 your webserver configuration. For Apache you can use supplied .htaccess
119 file in that folder, for other webservers, you should configure this
120 yourself. Such configuration prevents from possible path exposure and cross
121 side scripting vulnerabilities that might happen to be found in that code.
122 8. It is generally good idea to protect public phpMyAdmin installation against
123 access by robots as they usually can not do anything good there. You can do
124 this using robots.txt file in root of your webserver or limit access by web
125 server configuration. You can find example .htaccess file which can help
126 you achieve this in contrib directory in phpMyAdmin.
127
128phpMyAdmin configuration storage
129
130For a whole set of new features (bookmarks, comments, SQL-history, tracking
131mechanism, PDF-generation, column contents transformation, etc.) you need to
132create a set of special tables. Those tables can be located in your own
133database, or in a central database for a multi-user installation (this database
134would then be accessed by the controluser, so no other user should have rights
135to it).
136
137Please look at your ./scripts/ directory, where you should find a file called
138create_tables.sql. (If you are using a Windows server, pay special attention to
139FAQ 1.23).
140
141If you already had this infrastructure and upgraded to MySQL 4.1.2 or newer,
142please use ./scripts/upgrade_tables_mysql_4_1_2+.sql and then create new tables
143by importing ./scripts/create_tables.sql.
144
145You can use your phpMyAdmin to create the tables for you. Please be aware that
146you may need special (administrator) privileges to create the database and
147tables, and that the script may need some tuning, depending on the database
148name.
149
150After having imported the ./scripts/create_tables.sql file, you should specify
151the table names in your ./config.inc.php file. The directives used for that can
152be found in the Configuration section. You will also need to have a controluser
153with the proper rights to those tables (see section Using authentication modes
154below).