Home
Join

10 Replies

  • user account is not created?  easily over looked.

    is there a connection string?

    was it using root login?  (hope not)

    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • 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".

    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • What permissions?  did you try as DBA just to see?  Did you assign just the specific schema or %?

    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • Open the mysql prompt in linux and issue

    mysql> use yourdbname

    and then try?  

    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • 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.

    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • 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

    Spice (1) flagReport
    0 of 1 found this helpful thumb_up thumb_down
  • Can anyone answer my initial question RE: a default database setting in mysql?  Or maybe have mysql automatically USE a specific database when a certain username logs in?
    To answer damon.theis concerns, yes, I am 100% certain that everything is the same.  Database name, user name, server IP, etc.  As I have explained before, my review of the tcp/ip streams show that the application server is connecting to the mysql server, and they are communicating just fine when no database selection is required.  The problem arises when the application server attempts an action that requires a database, and the error returned is no database selected.  Yes, I am certain that everything is embedded in the EXE, however unlikely that may be, and yes I am certain that there are no log files being created.  I reviewed this application extensively with procmon and wireshark before posting here.   
    Spice (1) flagReport
    Was this post helpful? thumb_up thumb_down
  • Maybe it's compatibility problem? What's your xampp version?

    Was this post helpful? thumb_up thumb_down
  • 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

    Was this post helpful? thumb_up thumb_down
  • 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?

    Text
    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();
    
    Was this post helpful? thumb_up thumb_down

Read these next...