C # An error occurred while connecting to remote mysql. The table does not exist [C # | MySQL | table 'tablename' doesn' t exist]

Source: Internet
Author: User
Preface
  
I haven't written any articles for a long time. I 've been busy with changing jobs and the end of the project. This time, I helped my friends to set up a C # program to connect to MySQL. I have encountered some problems. I 'd like to share it here.

Body
  1. Problem
    
SQL statement: Select purview from userinfo where name = 'admin' and Password = '000000'

    
The program is connected to the local MySQL database, and the execution of the preceding SQL statement is normal. Note that the table name is used when I create a table, in addition, the mysql version and database of the remote database (the MySQL database and application are not on one PC) are the same (the table structure exported using the mysqldump command ), however, when you switch to a remote connection, the following error occurs: Table database name. userinfo 'doesn' t exist.

  2. Solution
    
Change all table names to lowercase! That is: Select purview from userinfo where name = 'admin' and Password = '000000'

    
Note that userinfo remains unchanged.

  
3. The app. config file is attached.
    
Use app in winform. in the config file, if you directly modify the app. in the config file, for example, the database connection string does not work. During deployment, you should copy the application name .exe. the config file is not an app.configfile. You can manually modify the connection data warehouse strings or directly modify .exe. config.

Conclusion
  
The work has come to an end. extjs used in the front-end time also plans to take time to sort out several articles. Although it is far from proficient, its general application is enough and it has to continue to write articles to accumulate, otherwise, forget it quickly.

Related Articles of this blog

1. ^ all ^ SQL statements for obtaining SQL Server2000/2005, MySQL, and Oracle metadata [SQL statements from codesmith]
2. Oracle SYS users with the default password change_on_install cannot log on (error code: ORA-28009)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.