Tag Archives: The database

A PHP Error was encountered Severity: Warning Message: mysqli::real_connect(): Headers and client

When I upgraded MySQL, the PHP linked database reported an error. After checking the data, I found that the MySQL version was changed, which was inconsistent with the previously compiled version, so the error was reported. The solution was to recompile mySQLND, my MySQL and PHP installed by YUM were very simple.

killall php-fpm
yum remove php70w-mysql
yum install php70w-mysqlnd

After installation, just restart PHP-FPM!

You can’t specify target table ‘car’ for update in from clause

Error Code: 1093 occurs when the following SQL statement is executed:

update car set tag = 1 where id in (select id from car where brand_id=182 and tag=0);

The reason for the error is that the modified table and the queried table are the same table, which is not allowed in MySQL. We can solve this problem by querying again in the middle:

update car set tag = 1 where id in (select id from (select id from car where brand_id=182 and tag=0) As temp);

[resolved] exception java.net.ConnectException : Error opening socket to server Connection timed out.

The following error appears when using DB2 Data Studio to link to the server’s database: SQL4499N

Ensure that the data server has been started.
Check that the database name used is the actual database name and not an alias name.
Check that the host is a valid name or IP address, and that the port number is valid for communication with the data server.
To further diagnose the problem, return to the Properties section and use the Tracing page to enable tracing. Contact the 
database administrator and provide the trace and other support information available.
Full message content: [jcc][t4][2043][11550][4.13.111] Exception java.net.ConnectException: Error opening socket to server 
/127.0.0.1 on port 50,000 with message: Connection timed out.

When I went to the test server to check the connection, I found that I could not connect to the company’s internal network, so I could connect to the external network. Because I configured the static IP address.
Found that /etc/resolv.conf did not have a company gateway address. So after adding, you can connect the company Intranet. But the db2 connection problem remains.

Then checked the online information: https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014881167#77777777-0000-0000-0000-000014882240

Enter the following command:
Db2set DB2COMM=tcpip, which is the command to set the db2 connection to tcpip
Db2 UPDATE DBM CFG using SVCENAME db2c_db2inst1, this command should be used to add the service name to db2’s config file. And then restart DB2

[db2inst1@oc3354425588 ~]$ db2set DB2COMM=tcpip
[db2inst1@oc3354425588 ~]$ db2stop
SQL1064N  DB2STOP processing was successful.
[db2inst1@oc3354425588 ~]$ db2start
SQL1063N  DB2START processing was successful.
[db2inst1@oc3354425588 ~]$ vi /etc/services

[db2inst1@oc3354425588 ~]$ db2 update dbm cfg using SVCENAME db2c_db2inst1
DB20000I  The UPDATE DATABASE MANAGER CONFIGURATION command completed 
successfully.
[db2inst1@oc3354425588 ~]$ db2stop
dbSQL1064N  DB2STOP processing was successful.
[db2inst1@oc3354425588 ~]$ db2start
SQL1063N  DB2START processing was successful.

Enter db2 get DBM CFG to see all of db2’s config

[db2inst1@oc3354425588 ~]$ db2 get dbm cfg

          Database Manager Configuration

     Node type = Database Server with local and remote clients

 Database manager configuration release level            = 0x0f00

 CPU speed (millisec/instruction)             (CPUSPEED) = 1.259585e-07

 Max number of concurrently active databases     (NUMDB) = 32
 Federated Database System Support           (FEDERATED) = NO
 Transaction processor monitor name        (TP_MON_NAME) = 

 Default charge-back account           (DFT_ACCOUNT_STR) = 

 Java Development Kit installation path       (JDK_PATH) = /home/db2inst1/sqllib/java/jdk64

 Diagnostic error capture level              (DIAGLEVEL) = 3
 Notify Level                              (NOTIFYLEVEL) = 3
 Diagnostic data directory path               (DIAGPATH) = /home/db2inst1/sqllib/db2dump/
 Current member resolved DIAGPATH                        = /home/db2inst1/sqllib/db2dump/
 Alternate diagnostic data directory path (ALT_DIAGPATH) = 
 Current member resolved ALT_DIAGPATH                    = 
 Size of rotating db2diag & notify logs (MB)  (DIAGSIZE) = 0

 Default database monitor switches
   Buffer pool                         (DFT_MON_BUFPOOL) = OFF
   Lock                                   (DFT_MON_LOCK) = OFF
   Sort                                   (DFT_MON_SORT) = OFF
   Statement                              (DFT_MON_STMT) = OFF
   Table                                 (DFT_MON_TABLE) = OFF
   Timestamp                         (DFT_MON_TIMESTAMP) = ON
   Unit of work                            (DFT_MON_UOW) = OFF
 Monitor health of instance and databases   (HEALTH_MON) = OFF

 SYSADM group name                        (SYSADM_GROUP) = DB2IADM1
 SYSCTRL group name                      (SYSCTRL_GROUP) = 
 SYSMAINT group name                    (SYSMAINT_GROUP) = 
 SYSMON group name                        (SYSMON_GROUP) = 

 Client Userid-Password Plugin          (CLNT_PW_PLUGIN) = 
 Client Kerberos Plugin                (CLNT_KRB_PLUGIN) = 
 Group Plugin                             (GROUP_PLUGIN) = 
 GSS Plugin for Local Authorization    (LOCAL_GSSPLUGIN) = 
 Server Plugin Mode                    (SRV_PLUGIN_MODE) = UNFENCED
 Server List of GSS Plugins      (SRVCON_GSSPLUGIN_LIST) = 
 Server Userid-Password Plugin        (SRVCON_PW_PLUGIN) = 
 Server Connection Authentication          (SRVCON_AUTH) = NOT_SPECIFIED
 Cluster manager                                         = 

 Database manager authentication        (AUTHENTICATION) = SERVER
 Alternate authentication           (ALTERNATE_AUTH_ENC) = NOT_SPECIFIED
 Cataloging allowed without authority   (CATALOG_NOAUTH) = NO
 Trust all clients                      (TRUST_ALLCLNTS) = YES
 Trusted client authentication          (TRUST_CLNTAUTH) = CLIENT
 Bypass federated authentication            (FED_NOAUTH) = NO

 Default database path                       (DFTDBPATH) = /home/db2inst1

 Database monitor heap size (4KB)          (MON_HEAP_SZ) = AUTOMATIC(90)
 Java Virtual Machine heap size (4KB)     (JAVA_HEAP_SZ) = 2048
 Audit buffer size (4KB)                  (AUDIT_BUF_SZ) = 0
 Size of instance shared memory (4KB)  (INSTANCE_MEMORY) = AUTOMATIC(1048576)
 Instance memory for restart light (%) (RSTRT_LIGHT_MEM) = AUTOMATIC(10)
 Agent stack size                       (AGENT_STACK_SZ) = 1024
 Sort heap threshold (4KB)                  (SHEAPTHRES) = 0

 Directory cache support                     (DIR_CACHE) = YES

 Application support layer heap size (4KB)   (ASLHEAPSZ) = 15
 Max requester I/O block size (bytes)         (RQRIOBLK) = 32767
 Workload impact by throttled utilities(UTIL_IMPACT_LIM) = 10

 Priority of agents                           (AGENTPRI) = SYSTEM
 Agent pool size                        (NUM_POOLAGENTS) = AUTOMATIC(100)
 Initial number of agents in pool       (NUM_INITAGENTS) = 0
 Max number of coordinating agents     (MAX_COORDAGENTS) = AUTOMATIC(200)
 Max number of client connections      (MAX_CONNECTIONS) = AUTOMATIC(MAX_COORDAGENTS)

 Keep fenced process                        (KEEPFENCED) = YES
 Number of pooled fenced processes         (FENCED_POOL) = AUTOMATIC(MAX_COORDAGENTS)
 Initial number of fenced processes     (NUM_INITFENCED) = 0

 Index re-creation time and redo index build  (INDEXREC) = RESTART

 Transaction manager database name         (TM_DATABASE) = 1ST_CONN
 Transaction resync interval (sec)     (RESYNC_INTERVAL) = 180

 SPM name                                     (SPM_NAME) = oc335442
 SPM log size                          (SPM_LOG_FILE_SZ) = 256
 SPM resync agent limit                 (SPM_MAX_RESYNC) = 20
 SPM log path                             (SPM_LOG_PATH) = 

 TCP/IP Service name                          (SVCENAME) = db2c_db2inst1
 Discovery mode                               (DISCOVER) = SEARCH
 Discover server instance                (DISCOVER_INST) = ENABLE

 SSL server keydb file                   (SSL_SVR_KEYDB) = 
 SSL server stash file                   (SSL_SVR_STASH) = 
 SSL server certificate label            (SSL_SVR_LABEL) = 
 SSL service name                         (SSL_SVCENAME) = 
 SSL cipher specs                      (SSL_CIPHERSPECS) = 
 SSL versions                             (SSL_VERSIONS) = 
 SSL client keydb file                  (SSL_CLNT_KEYDB) = 
 SSL client stash file                  (SSL_CLNT_STASH) = 

 Maximum query degree of parallelism   (MAX_QUERYDEGREE) = ANY
 Enable intra-partition parallelism     (INTRA_PARALLEL) = NO

 No. of int. communication buffers(4KB)(FCM_NUM_BUFFERS) = AUTOMATIC(1024)
 No. of int. communication channels   (FCM_NUM_CHANNELS) = AUTOMATIC(512)
 db2start/db2stop timeout (min)        (START_STOP_TIME) = 10

 WLM dispatcher enabled                 (WLM_DISPATCHER) = NO
 WLM dispatcher concurrency            (WLM_DISP_CONCUR) = COMPUTED
 WLM dispatcher CPU shares enabled (WLM_DISP_CPU_SHARES) = NO
 WLM dispatcher min. utilization (%) (WLM_DISP_MIN_UTIL) = 5

 Communication buffer exit library list (COMM_EXIT_LIST) = 

If you only see if the service was added successfully:

[db2inst1@oc3354425588 ~]$ db2 get dbm cfg|grep SVC
 TCP/IP Service name                          (SVCENAME) = db2c_db2inst1
 SSL service name                         (SSL_SVCENAME) = 

Restart DB and the problem remains.

Later, I saw other materials on the Internet and said that it would not be the problem of the firewall… Then I looked at the firewall…

Computer-> Control Center-> Firewall-> Other Ports
Click the + sign, then in the popup dialog find Port 50000 | Protocal TCP | Service db2c_db2inst1, click OK. Click on the green in the upper left corner and check Apply.

Go back to Data Studio and try to connect again. The connection is successful!
Sure enough, it’s the firewall again… Lift the table!

An error occurred during the installation of assembly ‘Microsoft.VC80.CRT,version=”8.0.50727.42″,typ

An error occurred during the installation of the assembly ‘Microsoft. VC80. CRT, version = “8.0.50727.42” type = “win32” processorArchitecture = “x86, publicKeyToken =” 1 “fc8b3b9a1e18e3b’. Both Please refer to the Help and
this problem occurred when I was installing database 2012 for others. After some searching and thinking, the problem was solved.
* the problem said that a version of Microsoft.Vc80 was missing, after I solved the problem, I realized that this thing is a vs c++ configuration environment, I do not know why, you do not have this thing in your computer, so when installing the problem will pop up this problem. Simply download the widget, run it and install it.
it’s the software link:
link: https://pan.baidu.com/s/1PqE8SN6GOWIhvJkfZtdi0A
extraction code: owfc
copy this paragraph after open the baidu network backup phone App, operation more convenient oh
if you have any questions, welcome evaluation!

MySQL workbench insert data prompt error: 1046 (errorcode: 1046. No database select…)

Problem description:
The Error Code: 1046. Select the default DB to be 2 by double – clicking its name in the SCHEMAS list in the sidebar. 0.000 SEC

Error: The default database was not selected to receive the data
Solution: 1. Double-click the database you want to operate on
2. Execute the SQL statement
3. Check whether the data was inserted successfully

MySQL error: column ‘ID’ in field list is ambiguous

1. Error message

ERROR 1052 (23000): Column 'id' in field list is ambiguous

2. Cause analysis
Column ‘ID’ is repeated in the field list. In fact, two tables have the same field, but the name of the table field is not preceded by the name of the table, so the reference is unknown. The prefix student is no problem.
3. Solutions

SELECT student.name, student.student_id, score.score FROM student INNER JOIN score ONstudent.student_id = score.student_id WHERE student.name='mio';

+------+------------+-------+

| name | student_id | score |

+------+------------+-------+

| mio  |          1 |    99 |

| mio  |          1 |    77 |

| mio  |          1 |    88 |

| mio  |          1 |    99 |

+------+------------+-------+

4 rows in set (0.00 sec)

Follow my technical official account “Ramble on ARTIFICIAL Intelligence”, and push high-quality articles every day

error: File not found by glob???

Several situations that lead to the above problems:
1. The package name of RPM package contains such special symbols as “[,]”;
2. When rM-IVH XXXX. RPM, XXXX packet name does not exist;
3. The directory name at the top of RPM package does not exist or has problems; — I have made this trap of the problem, it took several days to solve.
Solutions:
1. Modify the package name of RPM package through MV;
2. Add packages to install in the installation directory;
3. Correct the directory name of RPM package to keep it consistent with the directory specified in the installation software;

Reproduced in: https://www.cnblogs.com/noxy/p/5794801.html

Summary of database

Group By
Group By and aggregation function can be used to achieve Group accumulation. For example, if you were asked to display the salary totals for each
department, you could use the following statement.
SELECT department_number
,SUM (salary_amount)
FROM employee
GROUP BY department_number;

result:
department_number Sum(salary_amount)
401 74150.00
403 80900.00
301 58700.00

note that all the fields accumulated without grouping in the SELECT clause must appear in the
GROUP BY clause, otherwise the following error message will be returned:
ERROR: 3504 Selected non-aggregate values must be part of the associated group.

for the above example the Department_Number field is not accumulated so it must appear in the group
BY clause. This basic rule must be borne in mind.

WHERE clause and GROUP BY clause
WHERE clause and GROUP BY clause
WHERE clause and GROUP BY clause are used together, GROUP BY only performs grouping aggregation calculation on data records that conform to the WHERE limit
system. In other words, the WHERE sub-
sentence removes unqualified data records before doing the actual aggregate calculation. What’s the combined salary for department 401 and 403?
SELECT department_number
,SUM (salary_amount)
FROM employee
WHERE department_number IN (401, 403)
GROUP BY department_number
;

results:
department_number Sum (salary_amount)
403 80900.00
401 74150.00

GROUP BY and ORDER BY
after the GROUP BY, ORDER BY makes the grouping statistics show
in the specified ORDER. For example, to show the number of people in a department, the total salary, the highest salary in a department, the lowest salary in a department
, and the average salary in a department by department number, you can use the following SQL statement:
SELECT department_number (TITLE ‘DEPT’)
,COUNT (*) (TITLE ‘#_EMPS’)
,SUM (salary_amount) (TITLE ‘TOTAL’)
(FORMAT ‘zz, ZZZ,zz9.99’)
,MAX (salary_amount) (TITLE ‘HIGHEST’)
(FORMAT ‘ ‘zz, ZZZ,zz9.99’)
,MIN (TITLE ‘amount)
(FORMAT ‘zz, ZZZ,zz9.99’)
,AVG (TITLE ‘AVERAGE’)
(FORMAT ‘zz, ZZZ,zz9.99’)
FROM employee
GROUP BY department_number
ORDER BY department_number
;

results are as follows:
DEPT #_EMPS TOTAL LOWEST AVERAGE
301 3 116,400.00 57,700.00 29,250.00 38,800.00
401 7 245,575.00 46,000.00 24,500.00 35,082.14
403 6 233,000.00 49,700.00 31,000.00 38,833.33

SELECT department_number AS DEPT
,COUNT (*) AS #_EMPS
,CAST (SUM (salary_amount) AS FORMAT ‘zz, ZZZ,zz9.99’)
AS TOTAL
,CAST (MAX (salary_amount) AS FORMAT ‘zz, ZZZ,zz9.99’)
AS LOWEST
,CAST (MIN (salary_amount) AS FORMAT ‘zz, ZZZ,zz9.99’)
AS br>,CAST (AVG (salary_amount) AS FORMAT ‘zz, ZZZ,zz9.99’)
AS _AVERAGE)
FROM employee
GROUP BY department_number
ORDER BY department_number; Since AVERAGE is itself a keyword, in the above example, it is preceded by an underscore
to distinguish it.
when grouping statistics on multiple fields, GROUP BY produces only one level of summary. Example
such as: for the department 401 and 403 according to the work code group statistics salaries.
SELECT department_number
,job_code
,SUM (salary_amount)
FROM employee
WHERE department_number IN (401, 403)
GROUP BY department_number, job_code
ORDER BY 1, 2;

results:
department_number job_code SUM (salary_amount)
401 411100 37850.00
401 412101 107825.00
401 412102 56800.00
401 413201 43100.00
403 431100 31200.00
403 432101 As you can see from this example, when there are multiple fields in GROUP BY, it can only produce a summary of level
, and the summary is made according to the last field (here is job_code).

GROUP BY and HAVING conditions
HAVING conditions clause is used together with GROUP to limit the result of grouping statistics to
and only return the grouping statistics that meet its conditions.
for example, show the number of people in the department, total salary, maximum salary in the department,
minimum salary and average salary in the department by department number order, if only show the department with average salary less than 36000.
SELECT department_number (TITLE ‘DEPT’)
,COUNT (*) (TITLE ‘#_EMPS’)
,SUM (salary_amount) (TITLE ‘TOTAL’)
(FORMAT ‘zz, ZZZ,zz9.99’)
,MAX (salary_amount) (TITLE ‘HIGHEST’)
(FORMAT ‘ ‘zz, ZZZ,zz9.99’)
,MIN (TITLE ‘amount)
(FORMAT ‘zz, ZZZ,zz9.99)
,AVG (TITLE ‘AVERAGE’)
(FORMAT ‘zz, ZZZ,zz9.99’)
FROM employee
GROUP BY department_number
HAVING AVG (salary_amount) < 36000;

result:
DEPT #_EMPS TOTAL b> 401 7 245,575.00 46,000.00 24,500.00 35,082.14

1, WHERE: data records are used to qualify the tables that participate in the grouping aggregation operation. Only
data records that meet the criteria are selected to participate in the grouping aggregation.
2, GROUP BY: to GROUP the records that meet the WHERE clause
3, HAVING: to qualify the GROUP aggregation results that can be returned
4, ORDER BY: to specify the output ORDER of the results

DB2 SQL Error: SQLCODE=-206, SQLSTATE=42703


Encounter 206 this mistake, but my SQL statement did not write wrong ah!

Baidu said that my SQL statement is not the field wrong, but checked several times but there is no problem, my SQL statement is:

update  ZZC_ANTI_REPORT_HIT_RULES_LIST set APP_NO="33" where org="000000000005"

is really best not sister;

The final solution is that the scripting environment of dbVisualiazer cannot use double quotes, it must be single quotes; Oh, really.

update  ZZC_ANTI_REPORT_HIT_RULES_LIST set APP_NO='33' where org='000000000005'

Can’t initialize OCI. Error – 1 appears in toad for Oracle

After normal installation of Oracle Client or Oracle DB, open Toad, click Connet, and report Can’t initialize oci. error-1.

Solutions:
(1) Environment variable: Simply set path and add the path of Oracle Client to path
(2) Network /admin: add tnsnames.ora and find one or copy one
(3) The key step: Copy Toad’s entire folder to the Oracle Client path

IBM MQ Reason 2538(MQRC_ HOST_ NOT_ An example of error reason

Environment:.NET 4.0, MQ.NET client IBm.xMS (V2.0.0.3)
The test code is as follows:

       var factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
       var _connFactory = factoryFactory.CreateConnectionFactory();

       _connFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, "192.168.0.65");
       _connFactory.SetIntProperty(XMSC.WMQ_PORT, 1414);
       _connFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "XPP_QM");
       _connFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
       _connFactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
       _connFactory.SetStringProperty(XMSC.CLIENT_ID, string.Empty);

       var conn = _connFactory.CreateConnection();
       conn.Start();

Error:
IBM. XMS. XMSException: CWSMQ0006E: method is called ConnectionFactory. Abnormal received during the CreateConnection: CompCode: 2, Reason: 2538
. During the execution of the specified method, another component throws an exception. For more information, see Linked Exceptions. .
in the IBM XMS. Client. WMQ. WmqConnectionFactory. CreateProviderConnection (XmsPropertyContext connectionProps)
in the IBM, XMS. Client. Impl. XmsConnectionFactoryImpl. The CreateConnection (String userID. String password)
in the IBM, XMS. Client. Impl. XmsConnectionFactoryImpl. The CreateConnection ()
in XRisk. MQ. MQConnection. Open (Boolean needLog) location e: \ xRisk4 – SRC \ XRisk MQ \ MQConnection cs: line number 314
Linked Exception : CompCode: 2, Reason: 2538
The real exception is reported in the following code.

IBM.WMQ.MQTCPConnection ---- < ParseLocalAddress(String) exit [o] rc=OK
IBM.WMQ.MQTCPConnection --- d Exception in method ConnectSocket(string,string,MQLONG)
IBM.WMQ.MQTCPConnection --- X System.Net.Sockets.SocketException (0x80004005): The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for
at System.Net.Dns.InternalGetHostByAddress(IPAddress address, Boolean includeIPv6)
at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
at IBM.WMQ.MQTCPConnection.ConnectSocket(String localAddr, String connectionName, Int32 options)
MQException CompCode: 2 Reason: 2538

The real reason is that in.NET 4.0, Microsoft changed the behavior of the interface Dns.GetHostEntry. When IP is used directly as a parameter, the report is not reported if the machine name or domain name is used.
The solution is as follows
1. Use ipAddres.tryparse () or Dns.Resolve(String) instead of Dns.GetHostEntry.
2. If you are using a third-party library and cannot modify the code, you can use the MACHINE name or domain name code for the IP. The above code can be changed to.

var factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
var _connFactory = factoryFactory.CreateConnectionFactory();

_connFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, "hostname");
_connFactory.SetIntProperty(XMSC.WMQ_PORT, 1414);
_connFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "XPP_QM");
_connFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
_connFactory.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
_connFactory.SetStringProperty(XMSC.CLIENT_ID, string.Empty);

var conn = _connFactory.CreateConnection();
conn.Start();

Reference:
http://connect.microsoft.com/VisualStudio/feedback/details/561083/dns-gethostentry-behaves-differently-in-net-4-0-than-previous-versions
http://stackoverflow.com/questions/2714449/problem-with-system-net-dns-gethostentrydnsserver-on-net-4-0
https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014538533#77777777-0000-0000-0000-000014538832

Reproduced in: https://www.cnblogs.com/jmax/p/3494320.html