Bug #11761 Editing connections via Preferences corrupts mysqlx_user_connections.xml
Submitted: 6 Jul 2005 8:37 Modified: 10 Aug 2005 22:11
Reporter: Jaakko Vallo Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Administrator Severity:S3 (Non-critical)
Version:1.0.22 OS:MacOS (OS X 10.3.9)
Assigned to: CPU Architecture:Any

[6 Jul 2005 8:37] Jaakko Vallo
Description:
I added a new connection via Preferences -> Connections. I gave it the necessary General information and on the Advanced Options I wrote an alternative (but valid) path and filename to the Connect Using Socket field. As long as I don't quit the program or select some other node on the left side Connections tree, the textfield holds the value, but if I do either of the abovementioned or try actually to connect with the newly created profile, the socket information vanishes.

In the mysqlx_user_connections.xml file I found the following:

  <user_connection>
    <connection_name>Testi</connection_name>
    <username>root</username>
    <hostname>127.0.0.1</hostname>
    <port>3306</port>
    <schema/>
    <advanced_options>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
      <advanced_option>SOCEKT_PATH=(null)</advanced_option>
    </advanced_options>
    <storage_path></storage_path>
    <notes></notes>
    <connection_type>0</connection_type>
    <storage_type>1</storage_type>
    <password/>
  </user_connection>

Apparently the "SOCEKT_PATH" should be "SOCKET_PATH". If I check the Compress Connection at the same time I give the socket the values save correctly one times each, except that "SOCKET" still reads "SOCEKT". On further testing even this seems a bit arbitrary, some times the socket path is saved, some other times it's not. Testing even further also the compression setting seems to sometimes save and some times not.

Extending the first case (at creation no explicit socket information is given and compression is not selected): If the XML-file is not modified by hand to remove the "null" entries, subsequent compression checkbox checking succeeds, but removing it crashes the program as the unchecking seems to leave "<advanced_option></advanced_option>" (or "<advanced_option/>") lines to the configuration file. This crashes the program next time it tries to read the file either when browsing between the different connections in the Pref's, or when trying to open the Connetion window.

How to repeat:
Go to the MySQL Amdministrator's preferences. Add a new connection by clicking the "+" at lower left. Select the connection named "new" and give it some connection information (no need to be valid when testing this). Close the Preferences window. Check the ~/Library/Application Support/MySQL/mysqlx_user_connections.xml file - you should see the errorneus lines.

Go back to the Pref's. Select the connection you just created. From Advanced Options check the Compress Connection. Close and open the Pref's, or select some other connection from the Connections tree and come back to the test connection. Uncheck the Compression box. Close Pref's and try to open Connection dialogue, or go back to Pref's. Either way the program should crash.

At first the latter operation may succeed, but after repeating these procedures for a while, crashing will happen. This is how it happened to me, atleast.
[6 Jul 2005 12:46] Aleksey Kishkin
It's in mysqlguicommon/source/mac/MConnectionEditor.m line 57
[10 Aug 2005 22:11] Alfredo Kojima
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html
[28 Apr 2008 18:30] Eric Szpyrka
I have had a similar problem running scheduled Backups on Win2k3 whereby a manually initiated backup is fine but when called from the Task Scheduler it fails to authenticate the user with Password=No.  I resolved this at long last by deleting any connections defined in MYSQL Administrator and deleting the xml file C:\Documents and Settings\Administrator\Application Data\MySQL\mysqlx_user_connections.xml.  I then recreated the user within connections, re-established the backup job and hey presto!