报错信息:

mysql> mysqladmin -uroot -p123456 password 654321;
ERROR 1064 (42000): 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 'mysqladmin -uroot -p123456 password 654321' at line 1

mysql> set password for root@localhost = password('654321');
ERROR 1064 (42000): 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 'password('654321')' at line 1

报错原因:

新版本MySQL(8.0以上)不支持使用mysqladmin -uroot -p123456 password 654321;“set password for root@localhost = password('654321');”来修改密码。

解决方法:

  • alter user'root'@'localhost' identified by '新密码';
  • alter user'root'@'localhost' identified with mysql_native_password by '新密码';

【ERROR 1064 (42000)】MySQL中使用mysqladmin或set修改root密码时提示语法错误的更多相关文章

  1. MySQL 修改 root 密码命令

    安装好 MySQL 并成功启动 MySQL 服务后,可以通过以下方法修改root密码: ①用 mysqladmin.exe 操作.指令如下: cd C:\Program Files\MySQL Ser ...

  2. mysql ERROR 1064 (42000): Erreur de syntaxe près de 'order)

    mysql> INSERT INTO page (author_username, page_title, addtime, cat_id, page_content,author_uid,it ...

  3. MySQL保留字 ERROR 1064 (42000)

    在MySQL(5.7.18)数据库中建表 CREATE TABLE SA_ACT_ITEM ( ITEMID ) NOT NULL, REGION ), ACTIONID ), ITEMNAME ), ...

  4. MySQL Workbench导出Model提示['ERROR 1064 (42000): You have an error in your SQL syntax....syntax to use near 'VISIBLE']

    CREATE TABLE IF NOT EXISTS `pihealth`.`warning_events` ( `wid` INT NOT NULL AUTO_INCREMENT, `wtime` ...

  5. mysql 报错ERROR 1064 (42000),原因使用了mysql保留字 (right syntax to use near 'groups)

    msql 8.0 执行语句: SELECT *  FROM groups; 会报如题的错误, 需加反引号进行修改: SELECT *  FROM `groups`; //////////分割线//// ...

  6. 【Mac系统】之Mysql数据库遇到修改数字密码的问题(SQL语法错误:ERROR 1064 (42000),密码策略等问题:ERROR 1819 (HY000))

    安装完Mysql也进行了第一次初始化密码以及修改密码规则(请参考文章),但是我想后续再改密码,出现了下面几个问题: #SQL语句错误问题 ERROR 1064 (42000): You have an ...

  7. ERROR 1064 (42000): You have an error in your SQL syntax;

    出现: ERROR 1064 (42000): You have an error in your SQL syntax; 1.SQL语句拼写错误. 具体很简单.慢慢查看 2.使用到了SQL关键字. ...

  8. mysql修改root密码和设置权限

    整理了以下四种在MySQL中修改root密码的方法,可能对大家有所帮助! 方法1: 用SET PASSWORD命令 mysql -u root mysql> SET PASSWORD FOR ' ...

  9. 数据库之mac上mysql root密码忘记或权限错误的解决办法

    [转自  http://blog.csdn.net/u014410695/article/details/50630233] 以下方法亲测有效,过程使用的工具只有mac的终端无需workbench 当 ...

随机推荐

  1. spring security在异步线程的处理

    https://spring.io/guides/topicals/spring-security-architecture 在异步线程中使用SecurityContextHolder , 需要将父线 ...

  2. TB3_Autorace之交通杆检测

    利用blob检测算法识别交通杆,控制TB3机器人完成对交通杆的起停动作! 上一篇博文中<TB3_Autorace之路标检测>订阅了原始图像信息,经过SIFT检测识别出道路交通标志,这里我们 ...

  3. Linux基础快捷键

  4. 初级vector

    标准库vector类型 #include<vector> using std::vector; vector为一个类模板. vector的初始化 vector<T> v1; v ...

  5. keepalive笔记之二:keepalive+nginx(自定义脚本实现,上述例子也可以实现)

    keepalive的配置文件 ! Configuration File for keepalived global_defs { notification_email { acassen@firewa ...

  6. mysql--sql_mode报错整理

    1.在5.7版本以上mysql中使用group by语句进行分组时, 如果select的字段 , 不是完全对应的group by后面的字段 , 有其他字段 , 那么就会报这个错误 ERROR 1055 ...

  7. HttpClient-get请求/Post请求/Post-Json/Header

    1.Pom文件添加httpClient 依赖 <dependency> <groupId>org.apache.httpcomponents</groupId> & ...

  8. 换到GitHub 博客了

    觉得还是github上面的代码风格看起来舒服些,所以决定把blog搬到github上面去了.以后这里就作为一个放资料的地方吧. github地址:http://l34rner.github.io/

  9. 2——PHP defined()函数

    */ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.cpp * 作者:常轩 * 微信公众号:Worldhe ...

  10. NumPy的随机函数子库——numpy.random

    NumPy的随机函数子库numpy.random 导入模块:import numpy as np 1.numpy.random.rand(d0,d1,...,dn) 生成一个shape为(d0,d1, ...