Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Tracking MySQL Outgoing Connections


I currently have this serious issue where a bunch of mysql connections are being sent from one of my servers to another. I think its a virus or some sort of hole in my scripting but my main server keeps on sending fake logins to my database server.

I do not know how this is happening, but IS THERE A WAY for the mysql client (not the database server) to track all of the outgoing connections that are being made?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Tracking Changes In MySQL
I'm trying a simple task of synchronizing MySQL and OpenLDAP. As a part of it, I donno how to detect changes in MySQL. Please let me know how to do that or point me to any source regarding that. Please reply soon as this is a part of my project.

Regarding Tracking Error Codes In MYSQL
how to retrive the errors in Mysql As i will do it in oracle like the below one:

DECLARE
code number;
BEGINcode:= SQLCODE;
SELECT * FROM table WHERE field = 1 and field_1 = 2;
dbms_output.put_line('The ErrorCode is '||code);
END;

Tracking MySQL Table Transactions
I am trying to understand how I could manage MySQL transactions. I have this database that contains a very important table. Its data changes a lot and contains student grades.
I could have another table where I would keep track of the original table's transactions. I make a backup of this table on a weekly basis and I'm thinking that if I keep track of the sql queries I could recreate the data at any point. So, if a user tels me that he/she overwrote the data, I would restore the portion of the table from the weekly backup, and then go to the transaction table and issue the queries up the point where the data is valid. Is this a good way of restoring data? Is there a better way? Does MySQL have a buil-in system of restoing data?

Tracking Database
Here's what I have:
1 database dedicated to this project.
1 table named "amount"
1 field named "donation"

An input form for the site owner to add donations to the database (tested and working, but...)

I cannot show the output of the fields as a total. If I do a query, it simply lists the donations. I want to display only the total so far (I may at a later date add a display of "who donated what" but that is not a consideration for this project).

Some details that may or may not matter:
Apache version 1.3.37 (Unix)
PHP version 4.4.3
MySQL version 4.0.27-standard

Tracking Arrivals &
I need to create a simple database that tracks equipment arrivals (and
departures) at my facility. What I want is to create a simple form,
which the receptionist could fill out, every time someone delivers
something at the front door. The form would simply have a place to put
the time/date, delivery method, addressee, and a brief description.
Once the receptionist filled it out and hit enter it would create a
new record and then send a summary notification email to a group of
people on site who would then process the equipment as needed.

Is there relatively simple way to do this in PHP & MYSQL? Basically
all I need to create a data entry form that also sends a notification
email. I was thinking I could just create a simple form on our
intranet site. I would also like a way to track items as they leave
the building as well.

Tracking Number Of Hits
For a project I am working on I need to track the number of hits per profile view. Originally I just stored the hit count in the profile table. Except now the client wants to be able to view reports showing number of hits between any two dates for any profile.

I really can't think of a good way to do this. This is all I can come up with for a table structure:

profile_hits
-date
-hit_count
-profile_id

The problem is I will be inserting a LOT of records into this table. It will work but perhaps there is a better way of doing this?

Tracking Unique Hits
I've got a simple database to track who looks at any given sale item on my site. The table is set up as such:

CREATE TABLE stats (
stats_id int(11) NOT NULL auto_increment,
stats_create int(11) NOT NULL default 0,
sale_id int(11) NOT NULL default 0,
user_id int(11) NOT NULL default 0,
user_ip int(11) NOT NULL default 0,
PRIMARY KEY (stats_id)
);
The `stats_create` field is a unix timestamp of when any given user looks at the sale. Currently, I came up with this to get the total number of hits over the last 7 days (today included) for any given $sale_id:

SELECT
DATEDIFF(CURDATE(), FROM_UNIXTIME(stats_create)) AS days_old,
COUNT(stats_id) AS hits
FROM stats
WHERE sale_id = $sale_id AND
DATEDIFF(CURDATE(), FROM_UNIXTIME(stats_create)) < 7
GROUP BY days_old
What I would like to do is to come up with a query that will select the number of unique hits over the last seven days. In other words, if user #2 has looked at this sale previously, their visit will be counted either 0 or 1 times (1 for the first time they visit--which would show up if that falls within the 7-day range; but 0 for all times thereafter). But as you can see, I have no idea how to formulate such a query.


Field/Record Revision Tracking
I am looking for a method to keep track of revisions. I have developed many
engineering database applications. Keeping tack of changes to fields is
often required and I have never implemented a method that looks/feels good.

There are two basic types of revisions. Revisions to field values and
revisions to groups of fields. An example of this is an application that
manages datasheets for instruments used in chemical processes. There is
data associated with the process itself and data associated with the
instrument serviceing that process. When a datasheet is ready to be issued
so the associated instrument can be purchased, a view of the related data is
produced as a 'datasheet'. This datasheet has a revision designation. If
any changes occur to the data associated to the datasheet after its initial
purchase issue, a new 'revision' must be published. Additionally, once,
say, the process data changes, the instrument develpement process may change
data multiple times before the datasheet is ready to issue again. 'Most' of
these revisions must be stored/managed before the next revision of the
datasheet is issued.

Tracking / Logging User Activity?
I already have a MYSQL server setup, and it is possible to track/log user activity, such as what tables in the database a user modifies and what they change it to?

Tracking Record Insertion And Deletion
I am writing some software that, among other things, needs to track
the state of database tables. This includes occasionally checking the
table to see what records or added, modified, or deleted. The added
and modified parts of this have not proven too difficult to implement,
but is there an easy/elegant way to determine what records have been
deleted from a mySQL table ??

I'm very to mySQL, and after reading through the docs about logs, the
only thing I can come up with is to make a slave of the target table,
and somehow catch the delete statements, but do a select instead
before deleting them from the slave.

Has anyone tackled this problem and can offer some advice, or pointers
to advice..

Tracking All DML And DDL Statements In Database Tables
I want to know one thing, i have a database which contains few tables and few default records in that.

Sometimes unusually some developer is truncating the tables or else dropping the table without my knowlege.

How can i track these changes in my database?

In Oracle, i heard that there are DDL and DML Triggers available but iam new to MYSQL. can anyone tell me is that any functionality available in MYSQL?

# Of Mysql Connections
I was wondering what you guys thought about this. How many mysql connections do you think is to many on a php page?

Mysql Connections
I am currently running MySQL 5.0 on RHE3.

I would like to know if someone can tell me how can I get the total number of connections/session to the mysql server via the console or command line?

MySQL Connections
A shared hosting provider allows to setup 10 MySQL databases. The only thing is that each database is forced into having its own username and password, which means a separate connection has got to be made to each database.
Is there a way to join tables over the two connections

How Do You Open Mysql To Outside Connections?
I have a DB server and an APP server.

I am trying to open MySQL on the DB server so the APP server can connect to it.

I did the command:

GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%'
IDENTIFIED BY 'PW' WITH GRANT OPTION;

However, it still won't connect.

Closing MySQL Connections
Here's a question for you, my hosts have told me that that one my pages,
php, was causing their server to reboot because there were too many open
connections and that they should be closed.

Now, correct me if I am wrong but I thought that the connections were closed
after a minute of inactivity.

Does this sound right? Could open connections cause their server to reboot a
lot, say 3 times in 15 minutes? If so, what can I do about it?

How Do You Stop All The Connections To MySQL?
I don't want any application accessing my databases while performing the recovery operations. In Oracle, you can stop the TNS listener on the server side. What is the equivalent of this in MySQL?

Managing MySQL Connections...
MySQL is currently reaching its limit of connections, and is not responding to new ones. What would prevent against this?

Would closing the connection through PHP at the end of every page help with mysqli_close();

Or should I set my max_connections in the my.ini configuration file to a higher number?

What other ways can lower the amount of connections?

Best Practices For Php/mysql Connections
I'm working on a data intensive project right now and though I'm able to write code I'm by no means a php or mysql guru, to say I know 'just enough' would be a good statement. So I'd like to ask those who know better...

Without going into specifics; users will be searching the database, and/or adding data to the database. I would estimate that there will be far more searches than additions/edits.

One of my main concerns is managing the connection to the database for each user. What would the most efficient method be, generally speaking? I would think that I do not want them to establish a connection for each request.

Getting Mysql Error Too Many Connections
I have limited controll of the server settings for MySQL all I can do is create a database, a database user and delete database. I can also use myPhP admin to manage the tables and stuff but as far as controlling the sql server thats all on the hosting company.

I recently set up a forum boards (SMF forums its great) all of a sudden one day I went to optimize the tables and whammo the whole board stopped working.

When I went to log into plesk and go into My Php admin it keeps giving me this error

"Welcome to phpMyAdmin 2.6.0-pl3

phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in config.inc.php and make sure that they correspond to the information given by the administrator of the MySQL server.

MySQL said:

#1040 - Too many connections

What exactly is this error and how do I fix it. I am a noobie with My Sql

is this a problem with my hosting companys server or is this an issue I can fix?

My hosting support said my database is corrupt (figured that much) but I can't restore untill I can overcome this error..

Several /tmp/mysql.sock Connections
I did a netstat -an and I saw around 80 lines like this:

c41cd9d8 stream 0 0 0 c41cd230 0 0 /tmp/mysql.sock

Is the server holding too many connections and then cant handle anymore?

What can I do to fix this?

I am running Mysql 3.23.49 with persistant connections off.

Netstat And 500 MySQL Connections
I was performing some benchmarking on my app and discovered that it opens 400-500 MySQL connections show by the netstat command:

tcp 0 0 enssbos:36185 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36184 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36191 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36190 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36189 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36188 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36179 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36177 enssbos:mysql TIME_WAIT
tcp 0 0 enssbos:36176 enssbos:mysql TIME_WAIT
.
Does this look right? Why are there so many tcp network connections for one script? I do use ajax with multiple updates, but I feel as if I am going to run into problems here.

Closing Persistent Connections In Mysql
it might be a stupid question,but I just want to know how can we close persistent connection in mysql (using php).

what are the advantages and disadvantages for using persistent connection?


MySQL Max Connections Remote And Local
My website runs on two servers. One is mean't for PHP and the other is the database MySQL. Whenever a request is made, the PHP attempts to connect to the MySQL via a remove host variable in the mysql_pconnect() function. This works fine, however when it comes down to having lots of connections in the my.cnf file, which one do I edit?

max_connections = 1000

Now do I set this in the MySQL only, or do I set it in the PHP server as well?

Remote MySQL Connections, Still Not Working
I've read, and done all the tutorials, forum posts, and comments I could find regarding setting up a mysql server access for remote connections, but I still seem to have problems. I have a LAMP server running behind a closed router connection. A dynamic DNS is masking the connection, and I have the appropriate ports open for HTTP, SSH, VNC, FTP, and I thought MySQL (3306). But for some reason I still cannot get MySQL to connect from a foreign host.

The I have port forwarding (3306) to the correct system behind the router, and I can access the server just fine via http/ftp. The MySQL server is happily running PHP MyAdmin with the localhost connection too. I've set a (actually a couple now) user to have the ip access of "%", and granted all permissions to that user, flushed the permissions, even restarted the server. I still can't get the remote connection to work.

Mysql Too Many Connections Performance Issues
I have a website running on a linux/apache/mysql/php
server. I receive about 8,000-10,000 visitors a day with about 200,000
to 300,000 page views. The server is a RedHat Linux server running PHP
5.x, MySQL 5.x, Apache 2.x

We have been suffering from a number of performance issues. Our
hosting company has set our max connections to 100, and we are using
persistent connections in PHP. At times the mysqld process takes 100%
of the CPU. We have also been suffering from
mysql_pconnect(): Too many connections errors. What can I do to fix
these issues?

When I run a top on the server I see this ...
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5567 mysql 16 0 169m 42m 4236 S 81.2 4.2 3078:09 mysqld
32539 apache 15 0 42676 25m 7708 S 1.0 2.5 0:03.40 httpd
32572 apache 15 0 42680 25m 7708 S 1.0 2.5 0:02.98 httpd
32608 apache 15 0 42680 25m 7704 S 1.0 2.5 0:00.72 httpd
32542 apache 15 0 42704 25m 7712 S 0.7 2.5 0:03.38 httpd
32561 apache 15 0 42732 25m 7712 S 0.7 2.5 0:02.61 httpd
32567 apache 15 0 42680 25m 7708 S 0.7 2.5 0:02.60 httpd
32591 apache ...................................................

Remote ODBC Connections To MYSQL
I have a requirement to do some standard table work with existing online survey software (PHP based- using MYSQL). I would like to test the ability to do this work from desktop clients such as access or open office.
I have set up an ODBC connection on my machine with appropriate passwords etc. When I run the test in the WinXP ODBC diaglog, it is says that connection is succesfull.

However, when I try to use the same DSN in ACCESS or the database component of Open Office, it is that it is unable to make the connection. For example in ACCESS, trying to link tables, the message comes that the ODBC call fails.]

In OPEN OFFICE when I do the test connection, I get "ACCESS DENIED" for user... which is the user account and password that I use in the web based projects.

External MySQL Connections Error
I'm trying to connect from my computer to my server. I add my computer to the allowed access hosts. And I'm able to logon correctly. But when I try to select the database I get this error: Access denied for user 'USER'@'%' to database 'DATABASE'

Any ideas?

How Can I Configure My MySQL Server To Allow OUTSIDE Connections?
how can i configure my MySQL server to allow OUTSIDE connections?

MySQL 4.0 Refusing Local Connections
I am hardly an expert on MySQL. I have limited knowlege on how MySQL 4.0 works.

I have used MySQL 4.0 nearly half a dozen times, using these steps, and everything working flawlessly.

Download MySQL 4.0 without installer, Extract it to c:mysql. go to c:mysqlin, run winmysqladmin.exe, it will prompt for a username and pass. I type in a fresh combonation. It will start up. I will install the service, and then add the service using the systray icon that appears from winmysqladmin.exe.

Now i am capable of logging in with root, set permissions, build databases, etc... etc...

For some reason, I cannot figure out why. It is now refusing all local connections.

The server is running windows 2000 advanced server. When i install it i do it with the remote desktop connection. simply because the server itself is 1300 miles away.

Webserver Leaving Many Unauthened Connections On Mysql
MySQL 4.0.24_Debian-10sarge2-log

I have a seperate mysql server and several webservers. One of them recently had an upgrade from debian 3.2 to 4 . Also many things like apache and php got upgraded. This webserver works, but its going slow sometimes. When I check mtop on the mysql server, I mostly see something like this :

ID User Host Command State
8606722 unauthen ip:422 Connect login
8606729 unauthen ip:422 Connect login
8606733 unauthen ip:422 Connect login
8606734 unauthen ip:422 Connect login

there are usually about 20-40 of those lines, with ip being that of the updated webserver. The only other lines are about 20 waiting 'Delayed, waiting for' lines for delayed inserts (wich is normal), and now and then a real mysql query.

All the other webservers do not seem te behave like this, so I'm not sure if this really is a mysql problem. But what I want to know is : what can I do to avoid those hanging connections ? Sometimes there are so many of them, that mysql is running out of connections and is blocking access from other webservers. I can raise this value ofcourse, but that is not a real solution of the core problem.

Mysql Heavy Load On Databases And Connections?
I'm preparing for a lot of potential traffic to a web app. My question is. Is there any restriction on the amount of databases you have on a single mysql installation on a linux server. Could there be any performance issue if for example I had 100,000 databases all being connected to at different times?

What is the upper limits of a standard LAMP dedicated server? What i mean is how many simultaneous connection can it handle before it starts to slow down for the users?

Cleaning Up MySQL Connections To Avoid 1040
Well, I'm trying to run
PHP

$result = mysql_query("SHOW FULL PROCESSLIST");
while ($row=mysql_fetch_array($result)) {
    $process_id=$row["Id"];
    if ($row["Time"] > 200 ) {
        $sql="KILL $process_id";
        mysql_query($sql);
    }
}


To clean up my connections, as I'm getting a 1040 error "too many connections". Of course, I can't run this until I can actually connect, unless there is a way around somehow. I don't have any admin rights, I just have a web-based "php my-admin" module to run the db.

Every page people access opens a mysql connection, and then it is closed with
PHP

mysql_close($connection);


. Would putting in
PHP

<?php mysql_close($connection); $NASI_connection = null;?>


MySQL Persistent Connections, Stored Procedures
We have a PHP/MySQL based website. It's our first project where the DB work is being handled my someone else the client hired. They are having us use a lot of stored procedures they created.

We've found that in order to run the procedures we have to use a persistent (mysql_pconnect) connection in our PHP scripts. Otherwise, using mysql_connect, ALL the stored procedures generate a mysql error. If we use pconnect they don't. Is this normal to have to use pconnect with stored procedures and if not, what could be the cause?

The second problem we are now running into is we are unable to connect to the database because we are exceeding the max connections. Even on our development server which uses a separate database on a separate server with maybe only has 5 or 6 different people that know about the website and use it.

The production site is maxed out, getting a too many connections error message. We are still invetigating but I believe they said there were 40 connections to the database. The website is inaccessible because it can't connect.

I guess another thing I'm curious about is on a website that is very DB intensive and has maybe a max of 50 simultaneous users at a time, what would a reasonable setting be for max connections on MySQL considering we have to use persistent connections?

MySQL Redhat Slow Responding To Connections
I have installed MySQL 3.53 on two RH7.3 and one RH9.0 boxes.
On one of the 7.3 and the 9.0 box, when I try to connect remotely, it
takes about 45 seconds to connect, whereas the other 7.3 box connects
almost immediately.

The fast box has standard install of 7.3 with tomcat added.
The 9.0 box is straight RH9.0 standard install.

I can't find anything in common between the slow boxes, but not on the
fast one.

Shouldn't Mysql_pconnect Force Reuse Of Mysql Connections?
I have this function I call everytime I need to make a query from within
my php-scripts:

function db_connect ($user, $pwd, $db, $debug = 0)
{
$link = @mysql_pconnect("localhost", "$user", "$pwd");
if($link && mysql_select_db("$db"))
if($debug == 1) {
printf("Connection OK!");
}
Return ($link);
if($debug == 1) {
printf("Connection not ok!");
}
Return (FALSE);
}

I thought that making another or a third call to db_connect would reuse
the same connection to the database, since I use mysql_pconnect() to
connect. But listing the active processes indicates something else: Code:

MySQL Server Initialize Broken Connections
I'm working on program that acts as MySQL client. After successful connection
program send queries for a long time. When I stop server mysql_query return
error (no surprise). But when I start server my program recieve information
again without connection reinitialization.

I suppose MySQL server track connections somehow but I didn't find any info
about it in documentation. Can somebody point me to docs or explain this
behaviour?

Maximum Number Of Connections In MYSQL (community Server)
how many maximum connections can reside in connection pool of MySQL server- community? Also what are the major differences between the Enterprise and community server versions?

Too Many Connections
Sometimes during busy parts of the day, my site shows a 'Too Many Connections' error.
I know it's something to do with the maximum default being 100, and that I need to change it in the my.cnf file. However I can't find the file.
Can someone tell me, step by step, how to create the file?



Too-many Connections
i am using MYSQL database in my system.i have public IP like (202.***.**.**)ie accessed
10 people in my organization.after some time it is showing too-many connections.

actually that is used only 10 persons but in my.ini file max_connections=255 are
255 but it is showing always too-many connections error.at that time we are restarting the system the problem is tempararyly solved?
what is the permenat solutions for that?

by using showprocesslist; command showing the list it is showing 10 users why it is showing the too-many connections?

How Many New Connections
How many connections Mysql cal handle

max_connections= ?

To Many Connections?
My host reported an error and said that my script was allowing to many connections.
Is there something that should be coded to close a connection after a user leaves the site? I thought this was automatic, but I guess not?? I can't imagine there were more than 50 users at one time on this certain site.

MAX CONNECTIONS
My site hasavailable by default 15 connetions to MYSQL.
Many connections remain open for much time, so when a
new user enter the page it shows a message UNABLE TO CONNECT TO DB.

How do I avoid this, without need change the number of connections
of the server?

Too Many Connections
i have an visual basic data entry application that use mysql database.
the app is installed on 6 computers.after each computer enters 4,5 data sheets,it gives the error TOO MANY CONNECTIONS

for connecting to mysql i created a mysql user MIHAI with all the privileges and

max_Questions
max_updates
max connections

set to 0 , wich means no limit for connections right??

but still, the error message, TOO MANY CONNECTIONS.

i read on mysql site

"The number of connections allowed is controlled by the max_connections system variable. Its default value is 100. If you need to support more connections, you should set a larger value for this variable."

but if i modify the max_connection textbox in mysql administrator isnt it the same thing?

Max Connections
I have stupidly set the max questions/conections options to such a low number that its locked me out before i even got a chance to play with this new version. Is there any way i can reset all the options and just start again. I have tried uninstalling and deleting the service from windows but on reinstall it just gives the same errors.

20 Connections
Is it normal for mysql's performance to plummet when it hits about 20 connections? These connections are all from scripts running as cron jobs.

I have max_connections set to 500 and max_user_connections set to 35.

Too Many Connections
I have been using a certain php file to connect to a mysql database for some time, but the last time that I checked it for bugs, I got an error message "Warning: mysql_connect(): Too many connections in /home/yonni/public_html/cgi-bin/register.php on line 19. ERROR 3: The connection to the registration database is temporarily unavaliable: Too many connections" I have not changed the coding for the connection to the database since I first wrote it. The code for this part of the script is:

$dbh=mysql_connect("localhost", "*my username*", "*my password*") or die ('ERROR 3: The connection to the registration database is temporarily unavaliable: '.mysql_error());
mysql_select_db("yonni_") or die ('ERROR 4: unable to select the correct database');

Why has this error occured, and is there a way of avoiding it? There is noone else viewing the site yet, and I do not know what the problem is. Please help

2 Connections
I create 2 connectionsand then try to select the current active database:

$aaa_link = mysql_connect("host1","user1","pass1") or die(mysql_error());
$bbb_link = mysql_connect("host2","user2","pass2")or die(mysql_error());

mysql_select_db("dbname1", $aaa_link) or die(mysql_error());

However, mysql_select_db fails with error:

Access denied for user: "user2" to database "dbname1"


Too Many Connections
I am running a couple sites off a mysql server and I am currently having a too many mysql_connect error:

CODEWarning: mysql_connect(): #08004Too many connections


Copyright © 2005-08 www.BigResource.com, All rights reserved