Some problems encountered in docking MySQL database

Source: Internet
Author: User

Environment: ASP. NET MVC uses Mysql.data to query other people's home library

The date saved in the 1.mysql database can be of type int, what time stamp is called, and I don't know why it's saved in this format

To convert to a DateTime format, you also need an SQL function:

SELECT id,title,writer,from_unixtime (' pubdate ') pubdate from dede_archives ORDER by pubdate Desc LIMIT 0,10

More Strange is from_unixtime (' pubdate '), inside the ' is the English state under the ESC key under the key, with ordinary English quotation mark conversion date is the default date "1970 ..."

The type of a field shorttitle in the 2.dede_archives table is char (36), which causes the connector to treat the type as a GUID type, prompting the following:

System.FormatException:Guid should contain digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
At System.Guid.TryParseGuidWithNoStyle (String guidstring, guidresult& result)
At System.Guid.TryParseGuid (String G, guidstyles flags, guidresult& result)
At System.Guid. ctor (String g)
At MySql.Data.Types.MySqlGuid.MySql.Data.Types.IMySqlValue.ReadValue (mysqlpacket packet, Int64 length, Boolean Nullval)
At MySql.Data.MySqlClient.NativeDriver.ReadColumnValue (Int32 index, Mysqlfield field, Imysqlvalue valobject)
At MySql.Data.MySqlClient.ResultSet.ReadColumnData (Boolean outputparms)
At MySql.Data.MySqlClient.ResultSet.NextRow (CommandBehavior behavior)
At MySql.Data.MySqlClient.MySqlDataReader.Read ()

For more information, please refer to: MySQL in char (36) is considered a GUID caused by the bug and solution

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.