Sphinx macos sql_connect: failed to load libmysqlclient
find /usr/ -name ‘libmysqlclient*’
Set variables
export DYLD_LIBRARY_PATH=/usr//local/Cellar/[email protected]/5.6.51/lib
Restart
indexer –all
Sphinx macos sql_connect: failed to load libmysqlclient
Restart
indexer –all
laravel-admin error
Error reporting information
An error occurs when running PHP artisan admin:make:
symfony\component\debug\exception\fatalthrowableerror: class'doc\dbal\driver\pdomysql\driver'not found
Operating environment
Windows 10
php:7.3.4
mysql:5.7.26
laravel:5.8
laravel admin:1.8.17
Cause
Doctrine/dbal not found
The reason why I read other people online may be that doctrine/dbal is 3* Caused by the version of.
Solutions
Run at terminal:
composer require doctrine/dbal:2.12.1
Or modify the composer.json as the following:
"require": {
*
*
"doctrine/dbal": "^2.12.1",
*
*
},
Then run
composer update
JAVA Operate Database Error: You have an error in your SQL syntax; Dao layer SQL statement error
Specific error reports are as follows:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,?,?,?,?)' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:944)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2491)
at com.mysql.jdbc.StatementImpl.executeUpdateInternal(StatementImpl.java:1552)
at com.mysql.jdbc.StatementImpl.executeLargeUpdate(StatementImpl.java:2607)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1480)
at cn.edu.wut.jwms.dao.TeacherDao.insertTeacher(TeacherDao.java:39)
at cn.edu.wut.jwms.testDao.testTeacherInsert(testDao.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
Error reporting location code:
public boolean insertTeacher(Teacher teacher) {
boolean b = false;
try {
//get the connection
Connection connection = JDBCUtil.getConn();
String sql = "INSERT INTO tb_teacher(teacher_num,teacher_pwd,teacher_name,teacher_tel,teacher_col_id) VALUES(?,?,?,?,?)";
//compile
PreparedStatement ps = connection.prepareStatement(sql);
//Assigning values to placeholders
ps.setString(1,teacher.getTeacherNum());
ps.setString(2,teacher.getTeacherPwd());
ps.setString(3,teacher.getTeacherName());
ps.setString(4,teacher.getTeacherTel());
ps.setInt(5,teacher.getTeacherColId());
int i = ps.executeUpdate(sql);//Number of rows affected by the update operation on the data
b = i>0?true:false;
//close the connection
connection.close();
} catch (Exception e) {
e.printStackTrace();
}
return b;
}
Process: check the SQL statements for many times and no errors are found. The test data is also checked for many times to confirm that the rules formulated during table creation are met;
Result. int i = ps.executeUpdate(sql); because in this code, pass in the sql statement again to report an error, modified to int i = ps.executeUpdate();; after the error is resolved.
Reason: The sql statement has already been passed in when the compile operation is executed, so it does not need to be passed in again when it is executed.
1. Error reporting details
fail to open MySQL connection: [CDC:ErrMySQLConnectionError]Error 1298: Unknown or incorrect time zone: 'Asia/Shanghai'
2. Troubleshooting
# Login tidb and check the time zone
show variables like '%time_zone%';
+------------------+---------------+
| Variable_name | Value |
+------------------+---------------+
| system_time_zone | Asia/Shanghai |
| time_zone | SYSTEM |
+------------------+---------------+
# login mysql and check the time zone
show variables like '%time_zone%';
+------------------+--------+
| Variable_name | Value |
+------------------+--------+
| system_time_zone | CST |
| time_zone | SYSTEM |
+------------------+--------+
It can be found that the time zone of the upstream tidb is North America/USA, while the time zone of the downstream MySQL is CST
3. Solution
Method 1: load the time zone
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p
Method 2: write sink to upstream and downstream time zones
cdc cli changefeed create --sink-uri="mysql://user:password@mysql_ip:mysql_port/?time-zone=CST" --pd=http://pd_ip:pd_port
error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver
July 08, 2019 2:39:14 PM com.alibaba.druid.pool.DruidDataSource error
WARNING:error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:520)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:583)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:598)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:655)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:686)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:776)
at edu.haizi.dao.UserDao.login(UserDao.java:17)
at edu.haizi.test.UserDaoTest.testLogin(UserDaoTest.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:518)
... 36 more
July 08, 2019 2:39:14 PM com.alibaba.druid.pool.DruidDataSource info
MESSAGES:{dataSource-1} inited
org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:598)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:655)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:686)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:776)
at edu.haizi.dao.UserDao.login(UserDao.java:17)
at edu.haizi.test.UserDaoTest.testLogin(UserDaoTest.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.sql.SQLException: com.mysql.cj.jdbc.Driver
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:520)
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:583)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
... 29 more
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:518)
... 36 more
Process finished with exit code -1
Solution: the version of MySQL under windows is higher than idea, which makes the version incompatible
Modify Maven dependency package
Original version 5.1.9
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.9</version>
</dependency>
Modify to a later version
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.28</version>
</dependency>
### Error updating database. Cause: java.sql.SQLException: Incorrect integer value: ‘**‘ for column
Type Exception Report
Message Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException:
Description The server encountered an unexpected condition that prevented it from completing the request.
Exceptions
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
### The error may exist in com/bjpowernode/dao/StudentDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into student(name,age) values(?,?)
### Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
### The error may exist in com/bjpowernode/dao/StudentDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into student(name,age) values(?,?)
### Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
com.sun.proxy.$Proxy14.insert(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
com.sun.proxy.$Proxy15.insertStudent(Unknown Source)
com.bjpowernode.service.impl.StudentServiceImpl.addStudent(StudentServiceImpl.java:19)
com.bjpowernode.controller.StudentController.addStudent(StudentController.java:26)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:371)
com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498)
org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
com.sun.proxy.$Proxy14.insert(Unknown Source)
org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
com.sun.proxy.$Proxy15.insertStudent(Unknown Source)
com.bjpowernode.service.impl.StudentServiceImpl.addStudent(StudentServiceImpl.java:19)
com.bjpowernode.controller.StudentController.addStudent(StudentController.java:26)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
):Note that the full stack information for the main issue can be viewed in the server logs
Solution:
The reason is that I mistakenly wrote the name type as int type. Open navicate to find the created table, right-click to find the design table, and change the name type to varchar
[Solved] pymysql.err.ProgrammingError: (1064, ‘You have an error in your SQL syntax;
Purpose
Use pymysql to insert data into the MySQL database.
Abnormal information
code
sql_test = '''INSERT INTO "es_site" ("id", "site_name", "site_role", "url", "password", "username") VALUES (1, 'test', 'test', 'https://test.com', 'passwd', 'estest');'''
cur.execute(sql_test)
conn.commit()
cur.close()
conn.close()
Solution
The field name in sql cannot be enclosed in quotation marks. Just remove the quotation marks of the field and table name
Error Code: 2013. Lost connection to MySQL server during query
Today, when using the official MySQL graphical tool mysqlworkbench to query the view, this error is reported:
error code: 2013 Lost connection to MySQL server during query
If the disk is not full, you can use the following method:
Modify the timeout in the red box. The default is 10 seconds. If the table data is too large and the query time is too long, the above error will be returned.
Error response from daemon: driver failed programming external connectivity on endpoint mysql
docker command:
docker start container_name/id
Container Start Error:
Error response from daemon: driver failed programming external connectivity on endpoint mysql (cf1ba9f9e0613e14f42332d187a51429f8213aaf91d775f2ec3600614c78e6e1): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 3306 -j DNAT --to-destination 172.17.0.2:3306 ! -i docker0: iptables: No chain/target/match by that name. (exit status 1)) Error: failed to start containers: mysql
Solution: restart docker:systemctl restart docker
https://blog.csdn.net/qq_45652428/article/details/124870923
mysql-community-server Install Error: error: Failed dependenice…
1. Problems encountered
There is no problem installing MySQL community common, MySQL community LIBS and MySQL community client, but there is an error when installing MySQL community server. There is a lack of libaio
dependency
2. Solve problems
Execute the command: yum - y install libaio
execute the command: rpm -ivh mysql-community-server-5.7.38-1.el7.x86_64.rpm
Error: Rsa Public Key not Find
Navicat for MySQL is a graphical tool for MySQL.
Resolve RSA public key not find
I found that the reason for this problem is that I didn’t put keyword
under the installation path of graphical tools
solution: copy keygen
to the installation directory of graphical tools.
No all pattern found! File Already Patched?
This prompt appears because you have previously registered with keygen
on your computer and cannot re register
solution:
1 Use Win + R to input regedit
instruction to edit the registry
2. Find HKEY in the registry_CURRENT_User\software\premiersoft
, and delete the directory
3. Reinstall the graphical tool.
Registration steps
premise: do not open it after successful installation
1. Copy keygen
to the installation directory of graphical tools
2. Select MySQL
, click patch
, and a registered patch will be generated in the installation directory
3. Click generate
in the corresponding column of keyword
to generate a serial number. At this time, first disable the network or disconnect the network
, open the graphical tool, select register
, fill in the serial number, click activate, and then select to activate
manually
4. At this time, a string of request codes will be generated. Paste them into keyword
, and click generate
in the corresponding column of activation code
to generate the activation code
5. Paste the activation code into the graphical tool, and the registration is successful.
Cause: I was testing the code of golang
connecting to the database. I finally reinstalled MySQL
and set up remote login, but this problem still occurred.
My SYZ-remote
account is specially created for remote login. Therefore, unlike the root
user, it does not have the due permission. We need to set its permissions in MySQL
.
View MySQL
account permissions through this code
mysql> SELECT host,user,password_expired,Grant_priv,Super_priv FROM mysql.user;
+-----------+------------------+------------------+------------+------------+
| host | user | password_expired | Grant_priv | Super_priv |
+-----------+------------------+------------------+------------+------------+
| localhost | root | N | Y | Y |
| localhost | mysql.session | N | N | Y |
| localhost | mysql.sys | N | N | N |
| localhost | debian-sys-maint | N | Y | Y |
| % | syz-remote | N | N | N |
+-----------+------------------+------------------+------------+------------+
5 rows in set (0.00 sec)
You can see that the permission of Grant_priv and Super_priv
in syz-remote
is N
We gave him authority
update mysql.user set grant_priv = 'Y', Super_priv='Y' where user = 'syz-remote';
Refresh it again
flush privilegs;