low_rents
low_rents

Reputation: 4481

passwords with special characters lead to an error in "toad for mysql"

My MySQL account has a password with the special char " in it. If I try to connect to the MySQL server with Toad for MySQL, it leads to following the error (I only got it in german):

System.ArgumentException Das Format der Initialisierungszeichenfolge stimmt nicht mit der Spezifikation überein, die bei Index '19' beginnt. Stack Trace: bei System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) bei System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey) bei System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules) bei System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value) bei MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor(String connStr) bei MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value) bei MySql.Data.MySqlClient.MySqlConnection..ctor(String connectionString) bei Quest.Toad.MySQL.MySQLConnection.CreateConnection() bei Quest.Toad.MySQL.MySQLConnection.DoBeforeConnect() bei Quest.Toad.Db.Connection.Connect(Boolean notify) bei Quest.Toad.Db.Provider.BackgroundConnector.CreateBackgroundConnection()

How do I avoid this error without having to change my password? (on another account which doesn't use special chars in the password it's working)

UPDATE: i also tried to escape it with \" - but it leads to the same error.

UPDATE 2: i also tried to write the password in single quotes like for example 'Pass"word' - also leads to the same error.

UPDATE 3: "Pass\"word" leads to the same error.

Upvotes: 1

Views: 1258

Answers (1)

Rahul
Rahul

Reputation: 77926

Use ' single quote around the password. So if password (for example) jell"y use it like

mysql -u root -p'jell"y'

Have Never used Toad but from Toad's support page it says to use

SET ESCAPE ON

Then escape the special character using \

Not sure but it may help. So thought of posting.

Upvotes: 1

Related Questions