<small id='ETl6E'></small><noframes id='ETl6E'>

  • <tfoot id='ETl6E'></tfoot>

        <i id='ETl6E'><tr id='ETl6E'><dt id='ETl6E'><q id='ETl6E'><span id='ETl6E'><b id='ETl6E'><form id='ETl6E'><ins id='ETl6E'></ins><ul id='ETl6E'></ul><sub id='ETl6E'></sub></form><legend id='ETl6E'></legend><bdo id='ETl6E'><pre id='ETl6E'><center id='ETl6E'></center></pre></bdo></b><th id='ETl6E'></th></span></q></dt></tr></i><div id='ETl6E'><tfoot id='ETl6E'></tfoot><dl id='ETl6E'><fieldset id='ETl6E'></fieldset></dl></div>
          <bdo id='ETl6E'></bdo><ul id='ETl6E'></ul>
      1. <legend id='ETl6E'><style id='ETl6E'><dir id='ETl6E'><q id='ETl6E'></q></dir></style></legend>
      2. 错误:选择命令拒绝用户 '<userid>'@'<ip-address>

        时间:2023-05-24

        <small id='YSSh5'></small><noframes id='YSSh5'>

      3. <legend id='YSSh5'><style id='YSSh5'><dir id='YSSh5'><q id='YSSh5'></q></dir></style></legend>

                  <tbody id='YSSh5'></tbody>
                <tfoot id='YSSh5'></tfoot>
                • <bdo id='YSSh5'></bdo><ul id='YSSh5'></ul>
                • <i id='YSSh5'><tr id='YSSh5'><dt id='YSSh5'><q id='YSSh5'><span id='YSSh5'><b id='YSSh5'><form id='YSSh5'><ins id='YSSh5'></ins><ul id='YSSh5'></ul><sub id='YSSh5'></sub></form><legend id='YSSh5'></legend><bdo id='YSSh5'><pre id='YSSh5'><center id='YSSh5'></center></pre></bdo></b><th id='YSSh5'></th></span></q></dt></tr></i><div id='YSSh5'><tfoot id='YSSh5'></tfoot><dl id='YSSh5'><fieldset id='YSSh5'></fieldset></dl></div>

                  本文介绍了错误:选择命令拒绝用户 '<userid>'@'<ip-address>'对于表 '<table-name>'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  在我的网站上,我使用的是 MySQL 数据库.我正在使用网络服务,在其中执行所有与数据库相关的操作.

                  In my website, I am using MySQL database. I am using a webservice where in I do all my database related manipulations.

                  现在在该网络服务的方法之一中,我收到以下错误.

                  Now In one of the methods of that webservice, I get the following Error.

                  select 命令拒绝用户 ''@''对于表 ''

                  select command denied to user '<userid>'@'<ip-address>' for table '<table-name>'

                  可能有什么问题?

                  以下是我收到该错误的代码.我尝试调试,发现它在行中失败

                  Below is the code where I get that error. I tried debugging and found that it fails at the line

                  MySqlDataReader result1 = command1.ExecuteReader();

                  这是我的代码:

                          String addSQL = "Select Max(`TradeID`) from `jsontest`.`tbl_Positions";
                          MySqlConnection objMyCon = new MySqlConnection(strProvider);
                          objMyCon.Open();
                          MySqlCommand command = objMyCon.CreateCommand();
                  
                          command.CommandText = addSQL;
                           MySqlDataReader result = command.ExecuteReader();
                          //int j = command.ExecuteNonQuery();
                           while (result.Read())
                           {
                               MaxTradeID = Convert.ToInt32(result[0]);
                           }
                          objMyCon.Close();
                          for (i = 1; i <= MaxTradeID; i++)
                          {
                              String newSQL = "Select `Strike`,`LongShort`,`Current`,`TPLevel`,`SLLevel` from `json`.`tbl_Position` where `TradeID` = '" + i + "'";
                              MySqlConnection objMyCon1 = new MySqlConnection(strProvider);
                              objMyCon1.Open();
                              MySqlCommand command1 = objMyCon1.CreateCommand();
                  
                              command1.CommandText = newSQL;
                              MySqlDataReader result1 = command1.ExecuteReader();
                             objMyCon2.Close();
                  

                  推荐答案

                  数据库用户没有权限进行选择查询.

                  database user does not have the permission to do select query.

                  如果你有mysql的root权限,你可以给用户授予权限

                  you can grant the permission to the user if you have root access to mysql

                  http://dev.mysql.com/doc/refman/5.1/en/grant.html

                  您的第二个查询在不同表的不同数据库上.

                  Your second query is on different database on different table.

                   String newSQL = "Select `Strike`,`LongShort`,`Current`,`TPLevel`,`SLLevel` from `json`.`tbl_Position` where `TradeID` = '" + i + "'";
                  

                  并且您所连接的用户无权访问此数据库或此特定表中的数据.

                  And the user you are connecting with does not have permission to access data from this database or this particular table.

                  你考虑过这件事吗?

                  这篇关于错误:选择命令拒绝用户 '<userid>'@'<ip-address>'对于表 '<table-name>'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 MySql 中的 DATETIME 字段的日期部分创建索引 下一篇:MySQL:NULL 与“"

                  相关文章

                  <i id='7KC7P'><tr id='7KC7P'><dt id='7KC7P'><q id='7KC7P'><span id='7KC7P'><b id='7KC7P'><form id='7KC7P'><ins id='7KC7P'></ins><ul id='7KC7P'></ul><sub id='7KC7P'></sub></form><legend id='7KC7P'></legend><bdo id='7KC7P'><pre id='7KC7P'><center id='7KC7P'></center></pre></bdo></b><th id='7KC7P'></th></span></q></dt></tr></i><div id='7KC7P'><tfoot id='7KC7P'></tfoot><dl id='7KC7P'><fieldset id='7KC7P'></fieldset></dl></div>
                • <small id='7KC7P'></small><noframes id='7KC7P'>

                      • <bdo id='7KC7P'></bdo><ul id='7KC7P'></ul>

                    1. <tfoot id='7KC7P'></tfoot>
                      <legend id='7KC7P'><style id='7KC7P'><dir id='7KC7P'><q id='7KC7P'></q></dir></style></legend>