修改mysql数据库的用户名和密码 Unknown column 'password' in 'field list'

通过命令行进入mysql

更改密码:

mysql -u root -p
Enter password:***
mysql>use mysql;  选择数据库
Database changed 
mysql> UPDATE user SET password=PASSWORD("新密码") WHERE user='你的用户名';
mysql> FLUSH PRIVILEGES;
mysql> quit;
出现Unknown column 'password' in 'field list'
采用如下语句来更新,因为新版本mysql采用authentication_string替代了password字段

update mysql.user set authentication_string=password('root') where user='root' ;

flush privileges;

 quit;

即可

更改用户名:

mysql -u root -p
Enter password:***
mysql> use mysql;  选择数据库
Database changed
mysql> update user set user="新用户名" where user="root";    将用户名为root的改为新用户名
mysql> flush privileges;    刷新权限
mysql> exit

Unknown column '????????????' in 'field list'

01-10

严重: Servlet.service() for servlet Faces Servlet threw exceptionrncom.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column '????????????' in 'field list'rn at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)rn at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)rn at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)rn at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)rn at com.mysql.jdbc.Connection.execSQL(Connection.java:3118)rn at com.mysql.jdbc.Connection.execSQL(Connection.java:3047)rn at com.mysql.jdbc.Statement.execute(Statement.java:692)rn at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:369)rn at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:343)rn at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:376)rn at com.jhb.tbclient.dao.CheckDAO.save(CheckDAO.java:17)rn at com.jhb.tbclient.service.TipsService.saveDictionary(TipsService.java:195)rn at com.btcms.dictionary.service.DictionaryManagerService.saveDictionary(DictionaryManagerService.java:307)rn at com.btcms.dictionary.DictionaryOperationBean.save(DictionaryOperationBean.java:213)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.operamasks.el.eval.ELEngine.invokeMethod(ELEngine.java:449)rn at org.operamasks.el.resolver.SingleMethodClosure.invoke(SingleMethodClosure.java:80)rn at org.operamasks.el.parser.ELNode$ACCESS.invoke(ELNode.java:1298)rn at org.operamasks.el.parser.ELNode.invokeMethod(ELNode.java:232)rn at org.operamasks.el.eval.MethodExpressionImpl.invoke(MethodExpressionImpl.java:83)rn at org.operamasks.faces.application.impl.ActionListenerImpl.processAction(ActionListenerImpl.java:107)rn at javax.faces.component.UICommand.broadcast(UICommand.java:383)rn at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:453)rn at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:770)rn at org.operamasks.faces.lifecycle.InvokeApplication.execute(InvokeApplication.java:42)rn at org.operamasks.faces.lifecycle.LifecycleImpl.doPhase(LifecycleImpl.java:135)rn at org.operamasks.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:83)rn at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.operamasks.faces.webapp.filter.DefaultSuffixRedirector.doFilter(DefaultSuffixRedirector.java:63)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)rn at java.lang.Thread.run(Thread.java:619)rn谢谢

没有更多推荐了,返回首页

私密
私密原因:
请选择设置私密原因
  • 广告
  • 抄袭
  • 版权
  • 政治
  • 色情
  • 无意义
  • 其他
其他原因:
120
出错啦
系统繁忙,请稍后再试