User already has more than 'max_user_connections' active connections - mysql-connect

I have one shared hosting account and i am running dynamic site there. i am facing below problem sometime where database record returns.
Warning: mysql_connect() [function.mysql-connect]: User myuser already has more than 'max_user_connections' active connections in path/db.php on line 4
Could not connect: User myuser already has more than 'max_user_connections' active connections
I am closing all connections like mysql_close($con) in each file where i execute the query;
is it just because of this ? or there could be some other issue?
can i trace out the problem where i am missing the mysql closing connection ?
can someone help me out ? Thanks

Do not open and close connection on each file or worse on each query. Make a file similar to connection.php where you put the mysql_connect statement and use require_once where you want to use it.
do not use mysql_close since the connection gets closed automatically each time the script finishes.

Related

How to solve Connection Error VB.net & SQL?

I have an application which runs perfectly, but sometimes I get the following error. I have attached the screen shot below. Can anyone help?
This error happens, when your application cannot connect to a server due to, for example incorrect connection string, which is not the case, since you said it works most of the time. To make sure everything is OK, validate your onnection string.
Second thing that comes to my mind is that, it your application just cannot connect with remote server, that database is running on. Try pinging your IP or DNS name in command line using ping and see what the result is.

error when adding tableadapter to dataset

I am developing a winforms application in Vb.net
when i try to add a tableadapter to an existing dataset I am receiving the error:
Failed to open a connection to the database.
"An attempt to attach an auto-named database for file ###Filelocation### failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share." Check the connection and try again.
This same dataset has 2 other tableadapters using the same dataconnection (as I am selecting the already existing dataconnection) which work fine
this connection is using application connection strings:
Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\test.mdf;Integrated
server=localhost;user id=root;password=password;database=testuser;persistsecurityinfo=True
this error pops up every time I select the dataconnector on the first window that pops up.
Why is this happening
additional info:
The other 2 tableadapters were added to this dataset using a different computer
this is for a mysql connection
I found this post on the MSDN forum:
An attempt to attach an auto-named database ....\aspnetdb.mdf failed
One of the suggestions is as Mr. DonBoitnott correctly says, add User Instance=True;. But, there's also another suggestion posted by Luke A.
"For the record, not one single error message given to me during the course of trying to fix this was relevant to the actual problem. Upon first receiving "An attempt to attached an auto-named database..." I looked online for every suggestion I could find: use an absolute path to the MDF, reorder TCP/IP and named pipes in the server configuration, disable/enable UserInstance (depending on where you looked), change security settings, reconfigure authentication, give specific login credentials.
None of these worked. All of these led to different vague/ambiguous error messages, which led to another problem which required a solution which led back to the original error message... an endless loop of problems, completely unrelated to what was actually wrong.
_Also, posts about setting correct permissions on the App_Data folder are deceptive, as they imply the default permissions were not sufficient for SQL Express (in fact, they are). The whole point of this VS environment is that you can develop a web application and plop it right onto an IIS/SQLExpress setup and have it work. This makes the applications more portable (within IIS, of course) and secure. Of course, everything configuration-related has been obfuscated enough to make it several orders of magnitude more difficult than it has to be."_
So: Try prepend Initial Catalog=uniquenamehere to your connection string.
Though he says "... where 'uniquenamehere' is some name for your project.", try replacing uniquenamehere with the actual name of the database where the table exists.
the file is a .mdf file so it is a mssql file
my guess would be that as you stated you are using mysql the connection string has to be a tad different and therefore the Dataset can't connect to Mysql
Try adding User Instance=True; to the connection string.

close tcp\udp connection by process name without killing the process Autoit script

I need help with this autoit script
It's close a tcp\udp connection of a process without killing the process
I found script in a forum but it's not working
let's say I want to close any connection established from "internet download manager"
so I put in process name
$processname = "IDMan.exe"
but it still not working !!
I guess some thing wrong in the code
Second : I want to but a WHILE loop to kill the process connection whenever it started
how can I do that
Here is the script without modifications
Link to script
sorry I tried to put the script source here but I failed
What you need is an Admin Rights.
Add this to the top of your script
#RequireAdmin
You can use CloseTCPConnectionByProcessName in a while loop, just add some sleep to keep it stable.

Oracle Shutdown error ORA-01033

I had installed Oracle 11g on windows 07,everything was working fine.But today it is giving me an error saaying ORA-01033: ORACLE initialization or shutdown in progress . I followed the steps mentioned in the different communities but unable to solve the error. After connecting as sqlplus sys/sys as sysdba. and executing below statement,i got following error. How to solve this error?
SQL> recover database;
ORA-00283: recovery session canceled due to errors
ORA-01110: data file 9: 'C:\APP\MKHATAL\ORADATA\ORCL\VELODBDATA.DBF'
ORA-01157: cannot identify/lock data file 9 - see DBWR trace file
ORA-01110: data file 9: 'C:\APP\MKHATAL\ORADATA\ORCL\VELODBDATA.DBF'
Thanks in advance!!
First, check your ALERT.LOG file typically located in D:\app\oracle\diag\rdbms\DBNAME\SID\trace\.
The latest entries in your ALERT.LOG should give you an indication on what is going on. Is the database starting? Shutting down?
Should the database be stuck in the shutdown process, you can try to kill the oracle.exe process and then restart the database via Windows Service.
Often, when the database seems to hang on startup, it is actually applying REDO to get a consistent state, so pay close attention on what the ALERT.LOG tells you.
There's more info needed to be able to solve similar issues. Questions like these are interesting to get answered:
To what level can you start the database ? None, nomount, mount or
open (exclude the last one in this case)
What does the ALERT.LOG file show ? This from the moment the first
issue is suspected to be around
An obvious question is just : what happened ? What action were you
doing when you saw the first error message ?
Can you shutdown the database ? If yes, which methods : normal,
immediate or abort only ? Know that stopping the database with ABORT
option may make problems bigger as they are already.
Did you try rebooting the server ? This is particularly an issue on
Windows, which is your case.
Depending on how you stopped the database, do you have a cold backup
?
Depending on RMAN still working : can you take a backup ? The RECOVERY you were trying is not bad, but it could be interesting to know what is happening on OS level with that file; Is it there ? If yes, is it locked or not ? Does the OS think it's a valid file ?

Microsoft Access can't save design changes because another user has the file open... but I am the only user?

Just a little background: I am using Access 2010 to create forms and VBA code in an Access 2003 format database. For some reason, Access 2007 format databases always corrupt on me when I make changes and save them with a particular group of objects, but that's for another discussion.
When writing VBA code in this Access 2003 database, any time my code breaks (via breakpoint or an unhandled error) and I make a correction, Access tells me that it can't save back to the database because another user has it open. However, I am the only user working on the database; this is a local copy of the database and it's sitting on my desktop.
The LDB file can't be deleted because Access is using it. When I first load the database, I see my machine name and "Admin" when opening the LDB in a text or hex editor. After a break, I see that plus a duplicate entry, but this time around "admin" has a lower-case "A."
Closing the database and reopening it fixes the problem but makes it needlessly cumbersome to debug my code. Anyone else encounter this issue and/or have a fix for it?
It might be helpful to know what your code is doing when this happens. Certainly that's not normal behavior. For instance, are you opening another database with New Access.Application? Are you using ADO or DAO to access records in the database with a connection string?
There are no external connections to the database at all.
It may not matter if there are external connections to the database if you are using a connection string to connect to the open database; not sure but that may be seen as an external connection... you may want to use CurrentDB for DAO, or CurrentProject.Connection as your ActiveConnection for any ADO queries.
I am assuming that this problem persists through reboots; but for the sake of argument, try closing out Access and going to the task manager to make sure you have no other instances of MSAccess.exe running. You might even try closing all Office products and/or making sure that Access is the only Office product running. I have seen some weird conflicts between Microsoft Communicator and Outlook; so it's not entirely out of the question for Access to have issues with another MS product.
You may also want to check the size of the database to make sure it's not exceeded 2GB. That causes the infamous "Invalid parameter" error; perhaps it might be causing this as well.
With no other details about how your program works, we may only be able to offer generic advice like this.
I have discovered a way to cause the problem discussed above (and thereby to correct it). Turns out if you create a database object and set it to the current database, you get this problem.
That is,
dim cdb as database
set cdb = currentdb
From this point on, you're cooked.
Instead, figure a way around this by possibly using currentdb directly or not using it at all.
This worked for me.
In your VBA Try checking that all your open Connections to the database are closed. Until the connection is open the LDB fill will be there.
Same symptom of not being able to save form or code mods after application had started. I found a workaround today! In the startup of my first form of the app, I had issued a "DAO.DBEngine.SetOption dbMaxLocksPerFile, 20000". Commenting this statement removed the problem. I did no further testing, but FYI, the DBEngine call was before any reference or attempt to use CurrentDB(). Also the current default on my Access 16 install is 9,500.
I thought I might answer here, since I stumbled upon this question while having a similar issue. Essentially, it boiled down to this: I could either edit forms, VBA, etc. or edit information in the local database (which I'm using as a cache) with currentDB. I also have a backend database, but the locking was clearly on the frontend database.
The solution ended up being weird, but stupidly simple. When the frontend starts up, I have it immediately create a connection to the backend using OpenRecordset (and similarly to you, that backend was still on my own computer for testing purposes). I tried temporarily disabling that code, and suddenly it wasn't an issue anymore. And it turns out, once I call currentDB, I can then call OpenRecordset to open the connection to the backend, and suddenly it isn't a problem anymore.
Tl;Dr: if you're calling OpenRecordset somewhere in your code to connect to a backend, be sure to call something like set db = currentDB beforehand, then everything works. (That is, probably until I publish this answer and Access then decides it doesn't want to anymore).
Why this fixed it is beyond me, someone with more knowledge can maybe answer that.
The solution:
options > current database > click enable -track name auto correct info