编程知识 cdmana.com

Detailed process of building phpMyAdmin in Linux

One .phpmyadmin Deployment process

1.1 Introduce

phpMyAdmin It's an example. PHP Based on , With Web-Base The mode is built on the website host MySQL Database management tools , Make it available to managers Web Interface management MySQL database . By this Web Interface can be a simple way to input complex SQL A better way of grammar , In particular, it is more convenient to process the import and export of a large amount of data . One of the bigger advantages is that phpMyAdmin With others PHP The program also runs on a web server , But you can use them anywhere HTML page , That is to say, remote management MySQL database , Easy to set up 、 modify 、 Delete databases and tables . You can also borrow it phpMyAdmin Create a common php grammar , It's convenient to write web pages sql Grammatical correctness .

1.2 Functional characteristics

PHP Is a server-side to create a dynamic website scripting language , It can be used PHP and HTML Generate website home page . When a visitor opens the home page , The server will execute PHP And send the execution result to the visitor's browser , This is similar to ASP and CoildFusion, However PHP What's different from them is that PHP Open source and cross platform ,PHP Can run in WINDOWS And multiple versions of LINUX On . It doesn't need any pre-processing to quickly feed back the results , It doesn't need mod_perl To reduce the memory image of your server .PHP Less resources are consumed , When PHP As ApacheWeb Part of the server , You don't need to call an external binary program to run the code , The server doesn't have to bear any extra burden .
In addition to being able to manipulate your page ,PHP And send HIIP The title of the . You can set cookie, Manage digital signatures and redirect users , And it provides excellent connectivity to other databases ( also ODBC), Integrate various external libraries for use PDF Document parsing XML Anything .
phpMyAdmin It's a use. PHP Written software tools , Can pass web Mode control and operation MySQL database . adopt phpMyAdmin It can operate the database completely , For example, establish 、 Copy and delete data and so on . If you use the right tools ,MySQL Database management will become quite simple . application MySQL Command line mode needs to be correct for MySQL Knowledge is very familiar , Yes SQL The same is true of language . More Than This , If the database has a lot of access , Reading the data in the list can be quite difficult .
There are a lot of GUI MySQL Client procedure , The best of all is based on Web Of phpMyAdmin Tools . This is a kind of MySQL Database foreground is based on PHP Tools for .PhpMyAdmin The disadvantage is that it must be installed in Web Server , So if you don't have the right access , Other users may damage SQL data .

1.3phpmyadmin characteristic

Support most of the features :

  1. Browse and delete databases 、 surface 、 View 、 Areas and indicators
  2. establish , Copy , Delete , Rename and change the database 、 surface 、 Areas and indicators
  3. Maintenance server , Databases and tables , It is recommended to execute the configuration of the server , Any bookmark and edit sql-statement, even to the extent that batch-queries
  4. Manage users and permissions
  5. Manage stored procedures and triggers
  6. Import data from CSV and SQL
  7. Data export in various formats :CSV, SQL, XML, PDF, The standard 26300 Open document format, text, etc
  8. Manage multiple servers
  9. Create a graphic database layout
  10. Create complex queries, query by example
  11. Search in a global database or a subset of it to store data in any format using predefined functions , If displayed blob-data Image or downlink .

1.4zip and tar The difference is as follows

1.4.1 Concept

ZIP Is a file compression algorithm , Original name Deflate( vacuum ), The inventor is Philip · Katz, (Phil Katz)), He is in 1989 year 1 Information in this format was released in June .ZIP Suffixes are usually used “.zip”, its MIME The format is application/zip.
tar yes Unix And the class Unix Compression packaging tools on the system , You can combine multiple files into one file , The file suffix after packing is also “tar”.tar The file format is POSIX standard , Initially POSIX.1-1988, Now it's POSIX.1-2001.

1.4.2 Function and principle

ZIP Is a fairly simple archive format that compresses each file separately , His important role is to compress . Separately compressing files allows you to retrieve separate files without having to read additional data ; Theoretically , This format allows different algorithms to be used for different files .tar The order is Unix/Linux The important use of the system is to back up files ,tar Represents uncompressed tar file . Compressed tar The extension of the compressed file is appended to the file , If passing by gzip Compressed tar file , extension “.tar.gz”.

1.4.3 Usage environment and usage

ZIP Compression is mainly used in windows Under the system , Regular use winrar,360 Compression and other software to compress 、 decompression .

tar It is used in unix Under the system , Use... On the command line .
for example :

tar -cvf home_backup.tar /home( take /home All files in the directory are packed into home_backup.tar In file .)
tar -xvf home_backup.tar( Unzip in the current directory home_back.tar).

1.5 Deploy

Download the compressed package on the official website : https://www.phpmyadmin.net/
Some older versions are no longer maintained . Usually download tar Bag instead of zip package , because linux Yes tar The format has native support , and zip stay windows There are a lot of them .
tar Extract to the specified directory , Parameters -C
unzip Extract to the specified directory , Parameters -d
unzip xxx.zip –d /tmp Unzip to /tmp Next

1. decompression
unzip xxx.zip –d /web/dev

2. Change the group of the owner to apache
chown -R apache:apache /web/dev/phpMyAdmin-5.0.4-all-languages/

3. modify phpmyadmin Related configuration of
Cp config.sample.inc.php config.inc.php

config.inc.php Modify... In configuration file
18 That's ok :$cfg['blowfish_secret'] = 'jk8dE!mc'
Then it's randomly generated 8 Bit code , You must add
32 That's ok :$cfg['Servers'][$i]['host'] = 'localhost';
The address of the database server , If mysql Install on this machine , Then fill in localhost, If it's on another host , Then modify the ip/ domain name , The domain name should be in /etc/hosts I'm going to do the analysis

4. install php-fpm
yum install Open the service directly after , Will turn on 9000 port
systemctl start php-fpm

5. install nginx
Can directly yum install , It needs to be written here nginx Of yum Source , stay /etc/yum.repos.d Under the new nginx.repo file

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

newly build phpmyadmin Configuration file for
vim /etc/nginx/conf.d/phpmyadmin. Local domain name .conf

server {

        listen       80;
        server_name   domain name ;
        root   /xxx/phpMyAdmin-5.0.4-all-languages;
        index index.php index.html index.htm;

        location / {
                root /xxx/phpMyAdmin-5.0.4-all-languages;
                index index.php;
        }

        location ~ \.php$ {
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME /xxx/phpMyAdmin-5.0.4-all-languages/$fastcgi_script_name;
                include fastcgi_params;
        }
}

modify nginx Configuration file for ,include The path above

vim /etc/nginx/nginx.conf
include /etc/nginx/conf.d/*.conf;

Check for grammatical errors nginx –t
Start the service after there is no error
Systemctl start nginx

6. binding hosts
take nginx The domain name and local computer set in ip Binding in windows The host hosts In file
here , Access the domain name in the browser , You can see our login interface ~

in addition , Login username and password , Can be in mysql Created in .

版权声明
本文为[Think about the wind]所创,转载请带上原文链接,感谢
https://cdmana.com/2020/12/20201224142723015s.html

Scroll to Top