03-27-2014
- Define slow: Is the user sending SQL statements that take long to process/return? If yes, maybe check if the query uses indices or use a EXPLAIN PLAN, which will show what "costs" the query has and where improvements can be done. Use Google and you will find lots of helpful documents.
It can also be that there is another problem like a performance problem on the box, etc. Do other users/jobs have the same problem?
- The command you use will try to find associated processes for the directory /proc/21955180. This will not work the way you want it.
You should specify the correct switch for a PID, which is -p
This will most probably be the least thing to check why the connection or processing of queries is slow.
10 More Discussions You Might Find Interesting
1. AIX
hello
Sorry but i don't understand very well the lsof command with the man.
Can you explain to me what is the use of this command ?
thank you (2 Replies)
Discussion started by: pascalbout
2 Replies
2. UNIX for Dummies Questions & Answers
Using lsof command i can find out which process-id is associated with the port.
lsof -i :51000
. But as part of process i cant have lsof in the server.
I am using sun solaris 8 and only kshell. Is there a way to find out which process is using the above port. as of now i am gettn port... (1 Reply)
Discussion started by: logic0
1 Replies
3. Shell Programming and Scripting
Hi All,
i want the last login details along with year.
i tried below command but not giving me the year of last login.
last <$Userid> | head -1
i heard that if it is current year then it wont display the year else it will display the year. is it so?
if yes then , is there any way of... (1 Reply)
Discussion started by: ani_rvce
1 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
i want the last login details along with year.
i tried below command but not giving me the year of last login.
last <$Userid> | head -1
i heard that if it is current year then it wont display the year else it will display the year. is it so?
if yes then , is there any way of... (1 Reply)
Discussion started by: ani_rvce
1 Replies
5. Shell Programming and Scripting
Hello,
i am developing a simple shell script for simulation of wc command but it's not working.Please tell me what is the problem. I have commented the problematic line
if
then
echo "<Improper Usage>"
echo "wcassg <options> file"
else
eval file=\$$#
if
then
chars=0
words=0... (2 Replies)
Discussion started by: salman4u
2 Replies
6. Solaris
Hi,
Can anyone explain me the difference between fsuer and lsof commands. As per my knowledge both the commands are used to find the processes used by the current file system or user. Apart from that what is the major difference between these commands (3 Replies)
Discussion started by: rogerben
3 Replies
7. Shell Programming and Scripting
Hello,
I am running below command as root user
#nodetool cfstats tests | grep "Memtable switch count"
Memtable switch count: 12
Where as when I try to run same command as another user it gives different result.
#su -l zabbix -s /bin/bash -c "nodetool cfstats tests | grep "Memtable switch... (10 Replies)
Discussion started by: Pushpraj
10 Replies
8. Shell Programming and Scripting
#cat /tmp/input
old_array old_dev new_dev new_array
0577 008AB 01744 0125
0577 008AC 01745 0125
0577 008AD 005C8 0125
0577 008AE 005C9 0125
0577 008AF 005CA 0125
0577 008B0 005CB 0125
0577 008B1 005CC 0125
cat test.sh
#!/bin/ksh... (4 Replies)
Discussion started by: mbak
4 Replies
9. Shell Programming and Scripting
Hi,
i have a source file and have 3 columns and separated by "|" .i want to split this 3 columns in different variable.When i am executing this values indivisually giving correct result but when the same execute inside a for loop,it's giving issues.
Src file(jjj.txt)
-------... (8 Replies)
Discussion started by: raju2016
8 Replies
10. Shell Programming and Scripting
Hi,
I am trying to find the files in a specific directory that are currently in open state. I need this information to archive the old files that are not active in the directory.
I get the following output when I try the command $ lsof +d '/var/tmp/'|awk '{print $9}'|sort -u
NAME... (1 Reply)
Discussion started by: ryzen7
1 Replies
LEARN ABOUT PHP
mysql_query
MYSQL_QUERY(3) 1 MYSQL_QUERY(3)
mysql_query - Send a MySQL query
SYNOPSIS
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should
be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
omysqli_query(3)
o PDO::query
mixed mysql_query (string $query, [resource $link_identifier = NULL])
DESCRIPTION
mysql_query(3) sends a unique query (multiple queries are not supported) to the currently active database on the server that's associated
with the specified $link_identifier.
o $query
- An SQL query The query string should not end with a semicolon. Data inside the query should be properly escaped.
o $
link_identifier -The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect(3) is
assumed. If no such link is found, it will try to create one as if mysql_connect(3) was called with no arguments. If no connection
is found or established, an E_WARNING level error is generated.
For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query(3) returns a resource on success, or FALSE on
error.
For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query(3) returns TRUE on success or FALSE on error.
The returned result resource should be passed to mysql_fetch_array(3), and other functions for dealing with result tables, to access the
returned data.
Use mysql_num_rows(3) to find out how many rows were returned for a SELECT statement or mysql_affected_rows(3) to find out how many rows
were affected by a DELETE, INSERT, REPLACE, or UPDATE statement.
mysql_query(3) will also fail and return FALSE if the user does not have permission to access the table(s) referenced by the query.
Example #1
Invalid Query
The following query is syntactically invalid, so mysql_query(3) fails and returns FALSE.
<?php
$result = mysql_query('SELECT * WHERE 1=1');
if (!$result) {
die('Invalid query: ' . mysql_error());
}
?>
Example #2
Valid Query
The following query is valid, so mysql_query(3) returns a resource.
<?php
// This could be supplied by a user, for example
$firstname = 'fred';
$lastname = 'fox';
// Formulate Query
// This is the best way to perform an SQL query
// For more examples, see mysql_real_escape_string()
$query = sprintf("SELECT firstname, lastname, address, age FROM friends
WHERE firstname='%s' AND lastname='%s'",
mysql_real_escape_string($firstname),
mysql_real_escape_string($lastname));
// Perform Query
$result = mysql_query($query);
// Check result
// This shows the actual query sent to MySQL, and the error. Useful for debugging.
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "
";
$message .= 'Whole query: ' . $query;
die($message);
}
// Use result
// Attempting to print $result won't allow access to information in the resource
// One of the mysql result functions must be used
// See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc.
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}
// Free the resources associated with the result set
// This is done automatically at the end of the script
mysql_free_result($result);
?>
mysql_connect(3), mysql_error(3), mysql_real_escape_string(3), mysql_result(3), mysql_fetch_assoc(3), mysql_unbuffered_query(3).
PHP Documentation Group MYSQL_QUERY(3)