Mysql error: Unknown character set: & #39; utf8mb4 & #39;, mysqlutf8mb4

Source: Internet
Author: User

Mysql error: Unknown character set: 'utf8mb4', mysqlutf8mb4
Com. mysql. jdbc. exceptions. jdbc4.MySQLSyntaxErrorException: Unknown character set: 'utf8mb4'
At sun. reflect. NativeConstructorAccessorImpl. newInstance0 (Native Method)
At sun. reflect. nativeconstruct%cessorimpl. newInstance (nativeconstruct%cessorimpl. java: 57)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 526)
At com. mysql. jdbc. Util. handleNewInstance (Util. java: 411)
At com. mysql. jdbc. Util. getInstance (Util. java: 386)
At com. mysql. jdbc. SQLError. createSQLException (SQLError. java: 1052)
At com. mysql. jdbc. MysqlIO. checkErrorPacket (MysqlIO. java: 3609)
At com. mysql. jdbc. MysqlIO. checkErrorPacket (MysqlIO. java: 3541)
At com. mysql. jdbc. MysqlIO. sendCommand (MysqlIO. java: 2002)
At com. mysql. jdbc. MysqlIO. sqlQueryDirect (MysqlIO. java: 2163)
At com.mysql.jdbc.ConnectionImpl.exe cSQL (ConnectionImpl. java: 2618)
At com. mysql. jdbc. ConnectionImpl. configureClientCharacterSet (ConnectionImpl. java: 1880)
At com. mysql. jdbc. ConnectionImpl. initializePropsFromServer (ConnectionImpl. java: 3499)
At com. mysql. jdbc. ConnectionImpl. connectOneTryOnly (ConnectionImpl. java: 2384)
At com. mysql. jdbc. ConnectionImpl. createNewIO (ConnectionImpl. java: 2153)
At com. mysql. jdbc. ConnectionImpl. <init> (ConnectionImpl. java: 792)
At com. mysql. jdbc. JDBC4Connection. <init> (JDBC4Connection. java: 47)
At sun. reflect. NativeConstructorAccessorImpl. newInstance0 (Native Method)
At sun. reflect. nativeconstruct%cessorimpl. newInstance (nativeconstruct%cessorimpl. java: 57)
At sun. reflect. delegatingconstruct%cessorimpl. newInstance (delegatingconstruct%cessorimpl. java: 45)
At java. lang. reflect. Constructor. newInstance (Constructor. java: 526)
At com. mysql. jdbc. Util. handleNewInstance (Util. java: 411)
At com. mysql. jdbc. ConnectionImpl. getInstance (ConnectionImpl. java: 381)
At com. mysql. jdbc. NonRegisteringDriver. connect (NonRegisteringDriver. java: 305)
At java. SQL. DriverManager. getConnection (DriverManager. java: 571)
At java. SQL. DriverManager. getConnection (DriverManager. java: 215)
At com. silence. mysqlTest2.JDBCTools. getConnection (JDBCTools. java: 130)
At com. silence. mysqlTest2.JDBCTest. testInsertBlob (JDBCTest. java: 82)
At sun. reflect. NativeMethodAccessorImpl. invoke0 (Native Method)
At sun. reflect. NativeMethodAccessorImpl. invoke (NativeMethodAccessorImpl. java: 57)
At sun. reflect. DelegatingMethodAccessorImpl. invoke (DelegatingMethodAccessorImpl. java: 43)
At java. lang. reflect. Method. invoke (Method. java: 606)
At org. junit. runners. model. FrameworkMethod $1. runReflectiveCall (FrameworkMethod. java: 47)
At org. junit. internal. runners. model. ReflectiveCallable. run (ReflectiveCallable. java: 12)
At org. junit. runners. model. FrameworkMethod. invokeExplosively (FrameworkMethod. java: 44)
At org. junit. internal. runners. statements. InvokeMethod. evaluate (InvokeMethod. java: 17)
At org. junit. runners. ParentRunner. runLeaf (ParentRunner. java: 271)
At org. junit. runners. BlockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 70)
At org. junit. runners. BlockJUnit4ClassRunner. runChild (BlockJUnit4ClassRunner. java: 50)
At org. junit. runners. ParentRunner $ 3.run( ParentRunner. java: 238)
At org. junit. runners. ParentRunner $1. schedule (ParentRunner. java: 63)
At org. junit. runners. ParentRunner. runChildren (ParentRunner. java: 236)
At org. junit. runners. ParentRunner. access $000 (ParentRunner. java: 53)
At org. junit. runners. ParentRunner $2. evaluate (ParentRunner. java: 229)
At org. junit. runners. ParentRunner. run (ParentRunner. java: 309)
At org. eclipse. jdt. internal. junit4.runner. JUnit4TestReference. run (JUnit4TestReference. java: 50)
At org. eclipse. jdt. internal. junit. runner. TestExecution. run (TestExecution. java: 38)
At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. runTests (RemoteTestRunner. java: 467)
At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. runTests (RemoteTestRunner. java: 683)
At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. run (RemoteTestRunner. java: 390)
At org. eclipse. jdt. internal. junit. runner. RemoteTestRunner. main (RemoteTestRunner. java: 197)

Unknown character set: 'utf8mb4'. At the beginning, I thought it was caused by the inconsistent character encoding of mysql and the project encoding.

I spent most of my time searching for a long time on the Internet. In fact, it's not a problem with character encoding, it's a problem with the mysql driver-

Connector-java5.1.26 changed to mysql-connector-java5.1.6 and there is no error.

Related Article

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.