How to use the database --phpMyAdmin

This switched php Chinese network.

A, phpMyAdmin introduction

phpMyAdmin is one of many MySQL graphical management tool used in the most widely used, is a PHP-based development using B / S mode MySQL client software , the tool is Web-based, cross-platform hypervisor, and supports Simplified Chinese, users can download the latest version of the official website.

phpMyAdmin provides Web developers with similar Access, SQL Server database, graphical user interface, you can perform various operations by the management tool for MySQL, how to create a database, MySQL database tables and generate script files .

PHP is a scripting language used to create dynamic web-based server, you can generate website home page with PHP and HTML. When a visitor to open the home page, the server executes PHP commands and sends the results to the visitor's browser, which is similar to ASP and CoildFusion, however, PHP, and their difference is that PHP open source and cross-platform, PHP runs on WINDOWSNT and multiple versions of UNIX. It does not require any pre-processing and rapid feedback results, it does not need to be adjusted to make mod_perl memory image of your server is reduced. PHP consume fewer resources, when the PHP as a server part ApacheWeb, run the code does not need to call external binaries, the server does not need to bear any additional burden.

In addition to operating outside of your pages, PHP can also send HIIP title. You can set a cookie, managing digital signatures and redirect the user, and it provides excellent connectivity to other databases (as well as ODBC), integrating a variety of external libraries to do anything with the PDF document parsing XML.

phpMyAdmin is a software tool written in PHP, you can control and operation MySQL database through the web. The database can be completely operated by phpMyAdmin, such as create, copy, and delete data, and so on . If you use the right tools to manage MySQL database will become very simple. MySQL command line applications need to be very familiar with MySQL knowledge of SQL language is the same reason. Moreover, if a large amount of database access, data reading list will be quite difficult.

The current lot of GUI MySQL client program, the most remarkable is the Web-based phpMyAdmin tool. This is a PHP-based tool for MySQL database front desk.

PhpMyAdmin drawback is that must be installed on the Web server, so if there is no suitable access, other users may have damage to SQL data.

Second, the installation process

If you use an integrated installer to configure the PHP development environment, there is no need to download a separate graphical management tool phpMyAdmin, because integrated installation package basically contains the graphical management tools. Here we will use the integrated installation package phpStudy : http://www.php.cn/xiazai/gongju/89 .

First, download phpMyAdmin : https://www.phpmyadmin.net/

phpMyAdmin official download site, then extract to the web directory can be accessed, if it is a virtual space, after you can extract uploaded to the web directory by ftp tool, and the name of the file is unpacked, you can modify, you can also download the phpMyAdmin PHPstudy of replaced.

Second, the configuration

Config.default.php open files in the libraries directory, find the following items in turn, follow the instructions to configure.

1, visit URL

$ cfg [ 'PmaAbsoluteUri'] = ''; phpMyAdmin here to fill in the URL similar visit: http://127.0.0.1/phpMyAdmin/ .

2, MySQL Host Information

$cfg['Servers'][$i]['host'] = 'localhost'; // MySQL hostname or IP address

Fill in localhost or where the MySQL server's ip address, if the MySQL and phpMyAdmin on the same server, press the default localhost

$cfg['Servers'][$i]['port'] = ''; // MySQL port - leave blank for default port

MySQL port 3306 by default, can be left blank, use other ports if you install MySQL, need to fill in here.

3, MySQL user name and password

$cfg['Servers'][$i]['user'] = 'root'; //Fill in MySQL using phpMyAdmin to access the MySQL user name, the default is root.

fg['Servers'][$i]['password'] = ''; // 填写对应上述 MySQL 用户名的密码。

4, authentication method

$cfg['Servers'][$i]['auth_type'] = 'cookie';考虑到安全的因素,建议这里填写 cookie。

The four modes can be selected, cookie, http, HTTP, config

config mode is entered to access the phpMyAdmin URL to go directly, without the need to enter a user name and password is insecure, not recommended.

When this is set to cookie, http or HTTP, the data need to log in phpMyAdmin user name and password for authentication, as follows:

PHP installation mode for the Apache, you can use http and cookie;

PHP installation mode as CGI, you can use the cookie.

5, passphrase (blowfish_secret) settings

$ Cfg [ 'blowfish_secret'] = ''; if the authentication method is set to cookie, you will need to set a password phrase, how to set a password up to you, there can not be left blank, otherwise you will be prompted to log in phpMyAdmin error.

After installation is complete, we can access in your browser.

Third, create a database

In the address bar of your browser: HTTP: // localhost / phpMyAdmin / , carriage return, you can enter the main interface of phpMyAdmin. Then you can operate the MySQL database.

1. Create a database

In phpMyAdmin main screen, you can see the "language -languange" drop-down box, we can choose the drop-down box, "Chinese -Chinese simplified" option, then on there is a "server connection collation" utf8_general_ci we usually choose Simplified Chinese encoding format, to prevent distortion of the situation.

16069544-a06868bffdc77e0d.png

When the above settings Well, here I began to create the database, click on the top left of the database will appear the following interface:

16069544-ad7adc9b9bd4e419.png

You can create, it can be deleted. Then enter in the text box own database name, we are here "php.cn", although we set off this encoding format in the beginning, but in order in case, here again we can select the "utf8_general_ci" again, then after clicking the create button and then you can see the left column you create a database, as shown below:

16069544-a8cb26f737d00cb2.png

We can click the database we created, you can manage the database:


16069544-aed674185ebe85b9.png

The above is to create a database success!

2. Modify the database

In the database management interface (on the map), there is a "Actions" button, click into the page to modify the database.

1. Go to the top left of the page can be created to modify the operating data table for the implementation of the current database, create a data table hints are input data table name and the total number of fields of information to be created under the two text boxes, click the "execute" button, create a data table into the structure of the page, which we will detail later in the article.

2. You can rename the top right of the page to enter the modification of the database, the "database renamed:" input experience database name text box, click "Run" you can modify the database name successfully.


16069544-80264678786fc3ad.png

3. Delete the database

Also click the "Actions" button to enter the edit page, in the "New Data Table" immediately below is to delete the database, click on the database can be deleted,


16069544-8daa42a7e3f94f4a.png

Fourth, create a data table

After creating php.cn database, click php.cn database, the name "New Data Table" text box, enter the following data table and the number of fields, then click the "execute" button, you can create a data table, as shown below:


16069544-95ca91bc7bddf66e.png

After successfully creating a data table, the display interface data table structure, enter the details of each field in the form of the interface, including the field name, data type, length / value, encoding format, whether the air and the primary key and the like, to complete a detailed set of table structure, after all information is filled out, click "save" you can create a data table structure, shown in the following figure,

16069544-4f926aa7763481e2.png

skill:

After clicking the "Save" button, click "exemplar data name" data table structure can be displayed in a horizontal version, ease of editing structure!

2. Modify Data Sheet

After a new data table is created, enter data into the table structure page, where you can modify the table by changing the structure of the data table. Add columns may be performed, delete columns, column index, modifying the length / value data field of column type or the like operations, as shown below:


16069544-3445893b097a9439.png

3. Delete Data Sheet

Delete data tables with database much the same, enter the click data table data table structure of the page, and then the upper right corner there is a "operation button", click into the operation page, there is sort of modifications to the table on this page, the table may have moved to a different database , you can modify table options, and table maintenance, in the lower right corner there is a "delete data or data table," click "delete data Form" you can delete the data sheet! As shown below:


16069544-05e156d92498d8f5.png

Fifth, use SQL statements to manipulate data sheet Detailed graphics

(PhpMyAdmin use of tutorials 3) -mysql tutorial -PHP Chinese network http://www.php.cn/mysql-tutorials-360631.html

Sixth, the management of data records

After selecting one of the data table, there is a navigation position in the "Insert" button, click on the page is inserted into the input field values ​​in each page, click the "execution" button, the data can be inserted, as shown below:


16069544-cba1f06211c7d6da.png

Finally, click "Run" button, you can insert the data, as shown below:


16069544-688d22a8e9bf1ccb.png

2. Browse data

Select a data or after successfully inserted data, click on the navigation bar of the "Browse" button, enter the data display page, you can click data in the list of "Edit" button, you can edit the data, click "Delete" button , you can delete this record! As shown below:


16069544-aba995847b8f1126.png

3. Search data

After selecting a particular data table in the navigation bar, click on the "Search" button, enter the search page, you can select one or more columns in the selected fields list box. If you select multiple columns, press the Ctrl key, and then click to select the field name, the query results will be output in the field name selected.
In this interface, you can query the records according to the conditions, there are two ways to search:

The first: Choose where to build the query statement, query entered directly in the "Add search conditions" text box, and then click the button subsequent implementation.

The second: by using a column of the query, the query selection criteria, and the value of the text box to enter a query, click the "Execute button."

Seven, graphics import and export data tables Introduction

(PhpMyAdmin's tutorial 5) -mysql tutorial -PHP Chinese network http://www.php.cn/mysql-tutorials-360635.html

Guess you like

Origin blog.csdn.net/weixin_34112208/article/details/90843390