How to increase the connection timeout for mysql connection from c# application?How do I calculate someone's age in C#?How do you give a C# Auto-Property a default value?How do I enumerate an enum in C#?How do I connect to a MySQL Database in Python?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Get int value from enum in C#How to get a list of user accounts using the command line in MySQL?Reading settings from app.config or web.config in .netReference - What does this error mean in PHP?How do I import an SQL file using the command line in MySQL?

is it possible to terraform a planet made of human excrement into habitable planet?

monolingual dictionary

Does this smartphone photo show Mars just below the Sun?

Why does putting a dot after the URL remove login information?

How to halve redstone signal strength?

Is "safes" an acceptable alternative to "makes safe"

If someone else uploads my GPL'd code to Github without my permission, is that a copyright violation?

Is it double speak?

Why do dragons like shiny stuff?

"In charge of" vs "Responsible for"

How to dogfight in Elite: Dangerous?

How to switch an 80286 from protected to real mode?

What city skyline is this picture of?

Print only the last three columns from file

The size of sheafification

Is Odin inconsistent about the powers of Mjolnir?

How to continue a line in Latex in math mode?

How would a family travel from Indiana to Texas in 1911?

What is the German idiom or expression for when someone is being hypocritical against their own teachings?

NIntegrate doesn't work with NumericQ

What could prevent players from leaving an island?

Unexpected route on a flight from USA to Europe

Do any languages mention the top limit of a range first?

Traveling from Germany to other countries by train?



How to increase the connection timeout for mysql connection from c# application?


How do I calculate someone's age in C#?How do you give a C# Auto-Property a default value?How do I enumerate an enum in C#?How do I connect to a MySQL Database in Python?How do I get a consistent byte representation of strings in C# without manually specifying an encoding?Get int value from enum in C#How to get a list of user accounts using the command line in MySQL?Reading settings from app.config or web.config in .netReference - What does this error mean in PHP?How do I import an SQL file using the command line in MySQL?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I want to increase the connection timeout for mysql connection and I can not modify the timeout settings from administrator panel of mysql server. I want to do it within c# application and I noticed that I can read the property ConnectionTimeout of MySqlConnection class. I would like to know that is there a way to increase the connection time before opening mysql connection.










share|improve this question






























    1















    I want to increase the connection timeout for mysql connection and I can not modify the timeout settings from administrator panel of mysql server. I want to do it within c# application and I noticed that I can read the property ConnectionTimeout of MySqlConnection class. I would like to know that is there a way to increase the connection time before opening mysql connection.










    share|improve this question


























      1












      1








      1








      I want to increase the connection timeout for mysql connection and I can not modify the timeout settings from administrator panel of mysql server. I want to do it within c# application and I noticed that I can read the property ConnectionTimeout of MySqlConnection class. I would like to know that is there a way to increase the connection time before opening mysql connection.










      share|improve this question














      I want to increase the connection timeout for mysql connection and I can not modify the timeout settings from administrator panel of mysql server. I want to do it within c# application and I noticed that I can read the property ConnectionTimeout of MySqlConnection class. I would like to know that is there a way to increase the connection time before opening mysql connection.







      c# mysql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 18 '13 at 12:09









      User1551892User1551892

      1,9233 gold badges24 silver badges45 bronze badges




      1,9233 gold badges24 silver badges45 bronze badges

























          4 Answers
          4






          active

          oldest

          votes


















          6














          you can change ConnectionString as below:



          String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;Connection Timeout=30";


          in the above Connection String you can specify the number of seconds as value for Connection Timeout






          share|improve this answer
































            1














            use "default command timeout" in your connection string, it works for me



            Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
            default command timeout=20;


            https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-default-command-timeout/






            share|improve this answer
































              0














              Check out the wait_timeout parameter for my.ini



              Here is the link. restart mysql after changing the value.Why, because There may be multiple my.ini's on your system - make sure you're changing the right one



               http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout


              or



              you can define in your connection string



              String myconnstring = "Server=yourservername; Port=portno; Database=yourdatabasename; Uid=yourUSERID; Pwd=yourpassword;Connection Timeout=120";





              share|improve this answer
































                0














                default command timeout=0 in your connection string does the trick.



                String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;default command timeout=0";






                share|improve this answer



























                  Your Answer






                  StackExchange.ifUsing("editor", function ()
                  StackExchange.using("externalEditor", function ()
                  StackExchange.using("snippets", function ()
                  StackExchange.snippets.init();
                  );
                  );
                  , "code-snippets");

                  StackExchange.ready(function()
                  var channelOptions =
                  tags: "".split(" "),
                  id: "1"
                  ;
                  initTagRenderer("".split(" "), "".split(" "), channelOptions);

                  StackExchange.using("externalEditor", function()
                  // Have to fire editor after snippets, if snippets enabled
                  if (StackExchange.settings.snippets.snippetsEnabled)
                  StackExchange.using("snippets", function()
                  createEditor();
                  );

                  else
                  createEditor();

                  );

                  function createEditor()
                  StackExchange.prepareEditor(
                  heartbeatType: 'answer',
                  autoActivateHeartbeat: false,
                  convertImagesToLinks: true,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: 10,
                  bindNavPrevention: true,
                  postfix: "",
                  imageUploader:
                  brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                  contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                  allowUrls: true
                  ,
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  );



                  );













                  draft saved

                  draft discarded


















                  StackExchange.ready(
                  function ()
                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20657853%2fhow-to-increase-the-connection-timeout-for-mysql-connection-from-c-sharp-applica%23new-answer', 'question_page');

                  );

                  Post as a guest















                  Required, but never shown

























                  4 Answers
                  4






                  active

                  oldest

                  votes








                  4 Answers
                  4






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  6














                  you can change ConnectionString as below:



                  String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;Connection Timeout=30";


                  in the above Connection String you can specify the number of seconds as value for Connection Timeout






                  share|improve this answer





























                    6














                    you can change ConnectionString as below:



                    String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;Connection Timeout=30";


                    in the above Connection String you can specify the number of seconds as value for Connection Timeout






                    share|improve this answer



























                      6












                      6








                      6







                      you can change ConnectionString as below:



                      String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;Connection Timeout=30";


                      in the above Connection String you can specify the number of seconds as value for Connection Timeout






                      share|improve this answer













                      you can change ConnectionString as below:



                      String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;Connection Timeout=30";


                      in the above Connection String you can specify the number of seconds as value for Connection Timeout







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Dec 18 '13 at 12:13









                      Sudhakar TillapudiSudhakar Tillapudi

                      23.3k5 gold badges28 silver badges59 bronze badges




                      23.3k5 gold badges28 silver badges59 bronze badges


























                          1














                          use "default command timeout" in your connection string, it works for me



                          Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
                          default command timeout=20;


                          https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-default-command-timeout/






                          share|improve this answer





























                            1














                            use "default command timeout" in your connection string, it works for me



                            Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
                            default command timeout=20;


                            https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-default-command-timeout/






                            share|improve this answer



























                              1












                              1








                              1







                              use "default command timeout" in your connection string, it works for me



                              Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
                              default command timeout=20;


                              https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-default-command-timeout/






                              share|improve this answer













                              use "default command timeout" in your connection string, it works for me



                              Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
                              default command timeout=20;


                              https://www.connectionstrings.com/mysql-connector-net-mysqlconnection/specifying-default-command-timeout/







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Mar 27 at 4:32









                              Diego RiperaDiego Ripera

                              112 bronze badges




                              112 bronze badges
























                                  0














                                  Check out the wait_timeout parameter for my.ini



                                  Here is the link. restart mysql after changing the value.Why, because There may be multiple my.ini's on your system - make sure you're changing the right one



                                   http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout


                                  or



                                  you can define in your connection string



                                  String myconnstring = "Server=yourservername; Port=portno; Database=yourdatabasename; Uid=yourUSERID; Pwd=yourpassword;Connection Timeout=120";





                                  share|improve this answer





























                                    0














                                    Check out the wait_timeout parameter for my.ini



                                    Here is the link. restart mysql after changing the value.Why, because There may be multiple my.ini's on your system - make sure you're changing the right one



                                     http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout


                                    or



                                    you can define in your connection string



                                    String myconnstring = "Server=yourservername; Port=portno; Database=yourdatabasename; Uid=yourUSERID; Pwd=yourpassword;Connection Timeout=120";





                                    share|improve this answer



























                                      0












                                      0








                                      0







                                      Check out the wait_timeout parameter for my.ini



                                      Here is the link. restart mysql after changing the value.Why, because There may be multiple my.ini's on your system - make sure you're changing the right one



                                       http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout


                                      or



                                      you can define in your connection string



                                      String myconnstring = "Server=yourservername; Port=portno; Database=yourdatabasename; Uid=yourUSERID; Pwd=yourpassword;Connection Timeout=120";





                                      share|improve this answer













                                      Check out the wait_timeout parameter for my.ini



                                      Here is the link. restart mysql after changing the value.Why, because There may be multiple my.ini's on your system - make sure you're changing the right one



                                       http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout


                                      or



                                      you can define in your connection string



                                      String myconnstring = "Server=yourservername; Port=portno; Database=yourdatabasename; Uid=yourUSERID; Pwd=yourpassword;Connection Timeout=120";






                                      share|improve this answer












                                      share|improve this answer



                                      share|improve this answer










                                      answered Dec 18 '13 at 12:16









                                      Chandan KumarChandan Kumar

                                      3,2103 gold badges29 silver badges55 bronze badges




                                      3,2103 gold badges29 silver badges55 bronze badges
























                                          0














                                          default command timeout=0 in your connection string does the trick.



                                          String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;default command timeout=0";






                                          share|improve this answer





























                                            0














                                            default command timeout=0 in your connection string does the trick.



                                            String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;default command timeout=0";






                                            share|improve this answer



























                                              0












                                              0








                                              0







                                              default command timeout=0 in your connection string does the trick.



                                              String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;default command timeout=0";






                                              share|improve this answer













                                              default command timeout=0 in your connection string does the trick.



                                              String connectionString = "Server=myserver; Port=3306; Database=databasename; Uid=userid; Pwd=password;default command timeout=0";







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Jul 15 at 19:50









                                              Christian QuirósChristian Quirós

                                              3121 gold badge4 silver badges8 bronze badges




                                              3121 gold badge4 silver badges8 bronze badges






























                                                  draft saved

                                                  draft discarded
















































                                                  Thanks for contributing an answer to Stack Overflow!


                                                  • Please be sure to answer the question. Provide details and share your research!

                                                  But avoid


                                                  • Asking for help, clarification, or responding to other answers.

                                                  • Making statements based on opinion; back them up with references or personal experience.

                                                  To learn more, see our tips on writing great answers.




                                                  draft saved


                                                  draft discarded














                                                  StackExchange.ready(
                                                  function ()
                                                  StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f20657853%2fhow-to-increase-the-connection-timeout-for-mysql-connection-from-c-sharp-applica%23new-answer', 'question_page');

                                                  );

                                                  Post as a guest















                                                  Required, but never shown





















































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown

































                                                  Required, but never shown














                                                  Required, but never shown












                                                  Required, but never shown







                                                  Required, but never shown







                                                  Popular posts from this blog

                                                  Obelisk of Theodosius Contents History Description Notes Bibliography Further reading External links Navigation menuAge of spirituality : late antique and early Christian art, third to seventh centuryOver 60 picturesObelisks of the World41°00′21.24″N 28°58′31.43″E / 41.0059000°N 28.9753972°E / 41.0059000; 28.97539727724550-7235741376235741376

                                                  밀양 대씨 역사 각주 함께 보기 둘러보기 메뉴밀양 대씨

                                                  1973년 목차 사건 문화 탄생 사망 노벨상 달력 둘러보기 메뉴