Install and apply phpMyAdmin to manage MySQL databases

Source: Internet
Author: User
Tags web database
Learn to apply phpMyAdmin, a Web database-based governance tool. If appropriate tools are used, the MySQL database management will be quite simple. Using the MySQL command line method requires familiarity with MySQL knowledge and the same principle for SQL language. Not only does phpMyAdmin, a Web database-based governance tool, be used.

If appropriate tools are used, the MySQL database management will be quite simple. Using the MySQL command line method requires familiarity with MySQL knowledge and the same principle for SQL language. In addition, if the number of visits to the database is large, it will be very difficult to read the data in the list.

Currently, many GUI MySQL client programs are displayed, the most outstanding of which is the Web-based phpMyAdmin tool. This is a PHP-based MySQL database front-end tool. PhpMyAdmin must be installed on your Web server. if you do not have proper access permissions, other users may infringe on your SQL data.

The installation process of PhpMyAdmin is very simple. Download phpmyadminfrom http://www.phpmyadmin.net/and the latest version is 2.6.4-pl3. Decompress the downloaded file to the path you selected, such as/srv/www/domain.com/html/admin. Before you connect phpMyAdmin to the database, make sure that phpMyAdmin is protected. you can create an. htaccess file to complete the operation:



AuthUserFile /srv/www/domain.com/.htpasswd

AuthGroupFile /dev/null

AuthName adminAuthType basic



Order Deny,Allow

Deny From All

Allow From localhost

require user admin

satisfy any





The above code snippet makes it possible that the path/srv/www/domain.com is not protected, so the. htaccess file is outside the Web path (for example, the DocumentRoot in Apache is/srv/www/domain.com/html ). Use the htpasswd tool to create the/srv/www/domain.com/.htpasswdfile: create the/srv/www/domain.com/.htpasswd file using the htpasswd tool:



# htpasswd -cm /srv/www/domain.com/.htpasswd admin



Once you have provided the administrator's password, you can compile the config. inc. php file containing phpMyAdmin. You can compile the key words $ cfg ['pmabsoluteuri'] to point to the position of phpMyAdmin installed on the server, and then compile the $ cfg ['servers'] array. In order to quickly establish and run and compile all databases on the server, you need to provide permission verification:



$cfg['Servers'][$i]['host'] = 'localhost';

$cfg['Servers'][$i]['extension'] = 'mysql';

$cfg['Servers'][$i]['auth_type'] = 'config';

$cfg['Servers'][$i]['user'] = 'root';$cfg['Servers'][$i]['password'] = 'mysecretrootpass';



Now you can enter the ingress.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.