Managing MySQL Database with phpMyAdmin

Source: Internet
Author: User
Tags config mysql php file domain administrator password mysql database phpmyadmin web database

Learn to use phpMyAdmin based on Web database management tools.

If you use the right tools, the MySQL database management will be fairly simple. The MySQL command-line approach requires familiarity with MySQL knowledge, as well as the SQL language. Not only that, if the database has a large number of accesses, it can be quite difficult to read the data in the list.

Many GUI MySQL clients are currently present, the most outstanding of which are web-based phpmyadmin tools. This is a MySQL database at the front desk based on PHP tools. The disadvantage of phpMyAdmin is that you have to install it on your Web server, so if you don't have the right access, other users may be able to compromise your SQL data.

The phpMyAdmin installation process is very simple. Download phpMyAdmin from http://www.phpmyadmin.net/, and the current latest version is 2.6.4-PL3. Unzip the download file to the path you choose, such as/srv/www/domain.com/html/admin. Before you connect phpMyAdmin to the database, make sure that the phpMyAdmin is protected, which can be done by establishing an an. htaccess file:

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 the assumption that the path/srv/www/domain.com is not protected so the. htaccess file is outside the Web path (for example, DocumentRoot in Apache is/srv/www/domain.com/html). To create a/srv/www/domain.com/.htpasswd file using the HTPASSWD tool: 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 password, you can edit the config.inc.php file containing the phpMyAdmin. You will be able to edit the $cfg[' pmabsoluteuri ' keyword to point to the location installed in the server phpMyAdmin, and then edit the $cfg[' Servers ' array. To quickly build and run, and be able to edit all the databases on the server, you will need to provide the authority to prove:

$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 go into http://www.domain.com/admin/phpMyAdmin-2.6.4-pl3/and access your MySQL data, and you can rename the path to phpmyadmin/for easier access.







Related Article

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.