user account is not created? easily over looked.
is there a connection string?
was it using root login? (hope not)
Hi all.
I'm beating my head against the wall on this one, hopefully someone out there can help. I have an older application that takes an incoming raw tcp/ip connection, and posts the received data into a mysql database on another server. It has been working mostly flawlessly for over 10 years.
A couple of weeks ago our mysql server crashed. I was miraculously able to recover the database and get it up and running on a new ubuntu server. But even though the database is exactly the same as before, the application no longer works.
Unfortunately, the application doesn't have much in the way of options or configuration (or logging and error reporting). It was custom built to do one thing. I did a network capture, between the application server and the mysql server, and the error they mysql server is sending back to the application is "no database selected".
So, what I think is going on here is that the old mysql server had a "default database" that it would apply all incoming sql statements to if no database was selected. However, I cannot find any documentation on how to configure a default database on a mysql server. In fact, the documentation I have found indicates there is no such thing as a default database, but that doesn't explain why the application worked before, but not now.
Appreciate any help or insight anyone may have on this issue.
user account is not created? easily over looked.
is there a connection string?
was it using root login? (hope not)
damon.theis Thanks for the quick response!
Not using root, there is a dedicated user. The user has been created, and has the appropriate permissions. I'm sure there is a connection string, but it is an old application and I don't have the source code for it. The best I can do is review the tcp/ip communicaitons.
First the application server connects with username and password. That is successful.
Then it sends "SHOW VARIABLES;" and the mysql server responds with a ton of data
Then it sends "SHOW COLLATION;" and again the mysql server responds with a ton of data
Then it sends "SET NAMES utf8mb4;SET character_set_results=NULL;" the mysql server responds with OK
Then it sends a properly formed SELECT statement (omitted for security) and the mysql server responds with "NO DATABASE SELECTED"
Then it sends a properly formed INSERT statement (omitted for security) and the mysql server responds with "NO DATABASE SELECTED".
What permissions? did you try as DBA just to see? Did you assign just the specific schema or %?
yes, if I log into the mysql server directly (with the dedicated username) I have no issue performing any functions on the required database (after issuing the USE command of course). I don't think permissions are the issue. The issue is that the application doesn't seem to be set up to USE a database. The sql statements do not include a db name (I.E. they say "INSERT INTO tablename", not "INSERT INTO db.tablename"), and there doesn't seem to be any reference to the database name in the tcp/ip streams, so I can only assume that when it was created, the mysql server supported a default database that it doesn't support now.
Something must be missing or different. Name of the server, ip of the server, name of the db, location of the restore in mysql, how the application is executed? app.exe /usethisdb ? that's a stretch, i know.. lol What's the connection method? Connection settings always have a spot for the db. Is everything embedded in an exe? Unlikely. maybe use sysinternals to log the file access when you execute the app and see if it's looking for an ini or registry or something? Did you recover a my.cnf off of the old server? I also still suggest trying the user with DBO permission to see if anything changes unless you restored the user and permissions from a backup or documentation, - one of code screams quick and dirty... dbo it. lol
Maybe it's compatibility problem? What's your xampp version?
Not sure if this still works or would work in your case, been awhile since I've mySQL'd.
Might just need to set up a .my.cnf file on the machine/account that the application is running from.
https://superuser.com/questions/334818/how-to-change-the-default-database-for-one-user-in-mysql
CraiGrrr Thanks for the idea. I'm not sure where I would implement that, since the user in question is only a MySQL user, so there is no ~/username folder to put a my.cnf file in. I tried adding the database= line to the default my.cnf file and it didn't make a difference. :-(
I used ILSpy to rip apart the EXE. Here is the connection object, it looks like it is specifying the database name, so this is likely a compatibility issue like spicehead-ori9x suggested. However, I have no idea how to fix that since I cannot update the application, and I don't want to roll back the database. I know I had to update the my mysql commands in the PHP website to mysqli connections. Perhaps this is a similar issue, is there a way to tell MySQL to accept older connection types?
this.databaseType = serverSelectDialog.DatabaseType;
this.index = FD2FDF8C-A7CB-4023-AACB-248F41C42915;
this.MainConnection = new Connection();
this.MainConnection.Open(this.index);
settings.Password = *********;
settings.DatabaseName = CorrectDatabaseName;
settings.DataSource = 172.16.0.40;
settings.ErrorLoggingService = 172.16.0.40;
settings.LoggingBackupPath = c:\temp\error.log;
settings.LoggingDatabaseName = CorrectDatabaseName;
settings.LoggingPassword = ********;
settings.LoggingUserID = CorrectDatabaseUser;
settings.UserID = CorrectDatabaseUser;
settings.ConnectionName = UniqueName;
settings.Save();
Today in History: 16 August 1501 – Michelangelo awarded contract to create his statue of David at Florence Cathedral by the Overseers of the Office of Works (The Operai) of the Duomo 1691 – Yorktown, Virginia f...
I am doing a project for a non-profit museum and part of that is finding a way to mount 2 5 port ethernet POE switches (2 different locations) on a pole. This will have to be done in a small weather proof lockable box/cabinet. Basically, I am going to be ...
Your daily dose of tech news, in brief. Welcome to Tuesday, August 16th, which is also Tell A Joke Day. I imagine most of you know the common UDP joke so I'll go with another one. What wedding gift should you buy for a Windows administrator? I don'...
I’m awaiting the arrival of new switches. I’ve got a patch panel full of a tangled mess some 3-5m cables some to short etc…. our engineersmonskte have added some cables directly From rooms to the patch panel and they are just ends to go directly into swit...
I have ZERO experience on setting up AD, but I'm thinking on upgrading a network from customer to AD. Actually, they have just the server there with all folders shared to everyone, not even passwords on the shares.I'm assigned to fix it. They have 25 user...