Reason
We programmers have to deal with the database, after several years of exercise, feel that the handwriting SQL statement has been forgotten bad good, prompted me to this article is the reason why, one night I update a system of the database table (because the company is more stringent, the database can only be accessed through the command line, Cannot be manipulated through the GUI tool), and then the data is incorrectly updated because the Where condition was incorrectly written. The lesson : Use good tools to avoid this situation, that is phpMyAdmin
PhpMyadmin
phpMyAdmin is a PHP-based, web-base-style MySQL database management tool that is architected on a Web site host, allowing administrators to manage the MySQL database using a Web interface. This web interface can be an easy way to enter complex SQL syntax, especially to handle the import and export of large amounts of data. One of the bigger advantages is that because phpMyAdmin is executed on the Web server like any other PHP program, you can use the HTML pages generated by these programs anywhere, that is, to manage the MySQL database remotely, to easily create, modify, and delete databases and data tables. It is also possible to build common PHP syntax by phpMyAdmin, which is convenient for writing web pages with the correct SQL syntax
Yes, I'm looking for a search engine. In fact, I give you a simple explanation: PhpMyadmin using PHP written, you can access the MySQL database through the Web interface, for our research and development operations database provides a lot of convenient
Download
Go to the official website address https://www.phpmyadmin.net/, the most recent version download link
Https://files.phpmyadmin.net/phpMyAdmin/4.7.2/phpMyAdmin-4.7.2-all-languages.zip
Configuring Nginx Prerequisites
phpMyAdmin after decompression path:/home/vagrant/download/phpmyadmin
This article uses Nginx as webserver, use Apache's please find the solution
Need to be configured to run the PHP environment, personal use PHP-FPM
Nginx software path:/etc/nginx, virtual host path:/ETC/NGINX/CONF.D
Configuration content
Phpmyadmin.conf (full path:/etc/nginx/conf.d/phpmyadmin.conf)
server { charset utf-8; listen 80; server_namephpmyadmin.local; root /home/vagrant/download/ phpmyadmin; index index.php; location / { try_files $uri $uri/ /index.php? $args; } location ~ \.php$ { include fastcgi_params; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document _root$ fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php5-fpm.sock; try_files $uri =404; }}
Configure the Hosts
127.0.0.1 phpmyadmin.local
Access
Configuring phpMyAdmin single MySQL instance configuration
1) phpMyAdmin Source path:/home/vagrant/download/phpmyadmin
2) Enter/home/vagrant/download/phpmyadmin/libraries, locate the config.default.php file, open this file, locate
#找到这行代码 about 117 lines, change localhost to the IP you want to access the DB instance, for example 127.0.0.1$cfg[' Servers ' [$i] [' host '] = ' localhost '; #找到这行代码 about 124 lines, port default does not write when 3306 ports, if your DB instance port changed itself $cfg[' Servers ' [$i] [' port '] = '; #找到这行代码 about 524 lines, false to True, Indicates that a blank password login is allowed (must be set to False in the production line-wrapping database) $cfg [' Servers '] [$i] [' allownopassword '] = false;
If Allownopassword is not set to True, a prompt will appear when the password is empty
Multi-mysql instance configuration
A multi-database instance is actually the same as a single database, and its phpMyAdmin support
#在 /home/vagrant/download/phpmyadmin there is a config.sample.inc.php , copy a filename is config.inc.php# Edit config.inc.php, find First server, put the following code behind, the final result such as $hosts = [ 1 => [ ' host ' => ' localhost ', ' user ' => ', ' Password ' => ' ] , 2 => [ ' host ' => ' 192.168.22.21 ', ' user ' => ', ' Password ' => ' ],];foreach ( $hosts as $host _idx => $host _item ) { /* authentication type */ $cfg [' Servers '] [$host _idx][' auth_type '] = ' cookies '; /* server parameters */ $cfg [' Servers '] [$host _idx][' user '] = $host _ item[' user ']; $cfg [' Servers '] [$host _idx][' password '] = $host _item[' password '] ; $cfg [' SErvers '] [$host _idx][' host '] = $host _item[' host ']; $cfg [' Servers '] [$host _idx][ ' Compress '] = false; $cfg [' Servers '] [$host _idx][' Allownopassword '] = true;}
config.inc.php
Effect, isn't it cool, haha
At last
In fact, there are too many MySQL GUI tools, but on the Web page to do the better is phpMyAdmin, in the client software can recommend everyone try Navicat,sequel Pro (MAC)
Original address: "MySQL database access weapon" phpMyadmin
Tags: php mysql phpmyadmin allownopassword empty password login Navicat sequel
"MySQL Database access tool" PhpMyadmin