Brief description: multiple sub-station databases may leak their account and password.Details: This injection is dangerous and contains too many sensitive content.Proof of vulnerability: http://sml.56.com/index.php? Act = show Pid = 56
Database account password
51tv_php * 8A43D2A0EFC7C4883CCA541A84E53ED9BE42AC30 61.146.19213758bb520 * 0CA4B76111274A44D0E41142BA85899CBD8B095B localhostAzi * 2A032F7C5BA93287
Design a flexible and stable multi-layer architectureProgramIt is not easy. With mature models and applications, you also need to experience various applications and requirements. To put it bluntly, you must be able to withstand the difficulties. Recently, when restructuring your EPN framework, I have some new experiences and practices to share with you.
The first is the database design. A framework database drives multiple business logic
Mysql reads and runs commands through documents to quickly add multiple users and databases to mysql.
# Vi mysqlusers.txt
Create databaseDataname;Grant all privileges onDataname. *Username@ Localhost identified'Password';Flush privileges;
#/Usr/local/mysql/bin/mysql-u root-pPassword
The blue italic part is the corresponding user name and password. to add
Mysqldump-uroot-p111111-q-e-r-X--databases account game_s1 game_s2 ... > D:\backup.sql #自己用过的备份参数 for everyone's referencemysqldump More usage Reference http://blog.csdn.net/allen_a/article/details/51330658–quick,-qThis option is useful when exporting large tables, forcing mysqldump to cache records directly from the server query instead of getting all the records back into memory.--extended-insert,-EUse the Insert syntax with
Mysql simple batch backup of multiple databases bitsCN.com #! /Bin/bash
# This script is batch backup for mysql;
SQL _name = 'dbname1 dbname2 dbname3 ...... DbnameN-1 dbnamen'
SQL _pwd = '123'
For I in $ SQL _name
Do
Mysqldump-uroot-p $ SQL _pwd $ I >$ I-$ (date + % y-% m-% d-% H-% M ). SQL
Sleep 5
Done
Complete backup solution: After backing up all databases
Phplib is PHP's some extensions, using it we can easily do a variety of database operations, but if you want to use more than one database, it appears to be powerless, this article describes the expansion of the phplib, so that you have the fish and bear cake, You can use multiple databases while using Phplib, and you can also learn about object-oriented programming and how to extend the library's knowledge
There is a group of friends said the official example, but the English and internet is too poor ... Think for yourself.Recently developed projects, need to read some information from the external system, after the calculation into the local database, the external system directly provide the database to me. So a multi-database connection is needed locally.Project using ABP Framework development, unfamiliar can look hereTo start with, I already have a dbcontext in my project that inherits to Abpze
In our project, we may sometimes need to connect more than one database, how to implement it in CI?We have created two new databases locally, as follows:Modify the configuration file database.php file to the following format (readers modify the configuration of the corresponding parameters according to their own database):Create two files in the Applicaton/model directory: score.phpand students.phpTo modify the Welcome controller:To access the http://
This paper describes the method of yii2.0 database migration. Share to everyone for your reference, specific as follows:
Create a migration
Use the following command to create a new migration:
Yii migrate/create
The required parameter name functions as a brief description of the new migration. For example, if this migration is used to add fields to the same table for multiple databases (assu
/*methods of accessing different tables across multiple servers first create a linked server testt,* the RPC configuration of the linked server ' TESTT ' cannot be directly modified under MSSQL2008 to Ture, which can be modified by the following statements:*/ Use [Master]GOEXECMaster.dbo.sp_serveroption@server=N'Testt',@optname=N'RPC',@optvalue=N'true'GOEXECMaster.dbo.sp_serveroption@server=N'Testt',@optname=N'RPC out',@optvalue=N'true'GO--and then ac
Use PHPMYADIMN to connect to manage multiple databases to modify the configuration file, it is very uncomfortable, and connect to the remote database, speed is not. You can use other database administration tools,Please refer to, navicat combination shortcut key very good, open source, use MySQL management tool heidisql. If you want to use phpMyAdmin, there are two ways to connect and manage
])
Sends a query to the active database on the server associated with the specified connection identifier. If link_identifier is not specified, the last opened connection is used. If no connection is enabled, this function will try to call the mysql_connect () function without parameters to establish a connection and use it. The query results are cached.
In this example, because link_identifier is not specified, the last opened link, namely $ conn2, is used by default when the first SQL statem
, and so on the beginning of the library, the other go to write library. 3.2.Dynamicdatasource 3.3.Dynamicdatasourceholder 3.4.Datasourceaspect 3.5. Configure 2 data Sources 3.5.2.Defining connection Pooling SPRINGMVC is a child container, spring is the parent container, and the newly configured data source is added in the parent container's applicationcontext.xml configuration file 3.5.3. define DataSource In XML: 3.6.Configure transaction management and dynamically switch data
when it is loaded, if set to false, will be connected before first query $db [' Default '] [' Stricton ']=false;//true/false (Boolean)-whether to force the use of the "Strictmode" link, when developing the program,
Using Strictsql is a good habit $db [' DB2 '] [' hostname ']= ' localhost ';
$db [' DB2 '] [' username ']= ' root ';
$db [' DB2 '] [' Password ']=123456 ';
$db [' DB2 '] [' Database ']= ' DB2 ';
$db [' DB2 '] [' dbdriver ']= ' MySQL ';
$db [' DB2 '] [' dbprefix ']= '; $db ['
# Vi mysqlusers.txt
Create databaseDataname;Grant all privileges onDataname. *Username@ Localhost identified'Password';Flush privileges;
#/Usr/local/mysql/bin/mysql-u root-pPassword
The blue italic part is the corresponding user name and password. To add multiple users and databases, you only need to copy the code in the middle and modify the corresponding location, for example:Create databas
Example of using CI to operate multiple databases
Function _ construct ()
{
Parent: :__ construct ();
$ This-> xx = $ this-> load-> database ('XX', TRUE );
$ This-> load-> model ('default database and table name ');
}
Function index ()
{
// You can use $ this-> xx-> query () to execute the SQL statement of the X
The CI operation code of multiple databases in php. In fact, this is not difficult, because the CI just started, so it still took some twists and turns. Fortunately, there is a manual. Find the database configuration file and add the connection information of a new database. $ Config, in fact, is not difficult, because I just started with CI, so I still paid a weekly discount. Fortunately, there is a manual
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.