ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your

2023-11-17

以下是解决问题的过程:没整理
[root@localhost ~]# flush privileges;
bash: flush: 未找到命令…
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 8.0.28 MySQL Community Server - GPL

Copyright © 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> flush privileges;
Query OK, 0 rows affected (0.08 sec)

mysql> select user, authentication_string, host from user;
ERROR 1046 (3D000): No database selected
mysql> select user, authentication_string, host from user;
ERROR 1046 (3D000): No database selected
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show databases;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
±-------------------+
4 rows in set (0.00 sec)

mysql> select user, authentication_string, host from user;
±-----------------±-----------------------------------------------------------------------±----------+
| user | authentication_string | host |
±-----------------±-----------------------------------------------------------------------±----------+
| mysql.infoschema | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | localhost |
| mysql.session | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | localhost |
| mysql.sys | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | localhost |
| root | $A$005$3hlc7Dz0J>k_k#k90AQvZfa55jO5D.7B/8xl/NWXoxcJzClbsM0COL1s. | localhost |
±-----------------±-----------------------------------------------------------------------±----------+
4 rows in set (0.00 sec)

mysql> grant all privileges on . to ‘root’@‘192.168.62.129’ identified by ‘111111’ with grant option;
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 ‘identified by ‘111111’ with grant option’ at line 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> select user, authentication_string, host from user;
±-----------------±-----------------------------------------------------------------------±----------+
| user | authentication_string | host |
±-----------------±-----------------------------------------------------------------------±----------+
| mysql.infoschema | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | localhost |
| mysql.session | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | localhost |
| mysql.sys | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED | localhost |
| root | $A$005$3hlc7Dz0J>k_k#k90AQvZfa55jO5D.7B/8xl/NWXoxcJzClbsM0COL1s. | localhost |
±-----------------±-----------------------------------------------------------------------±----------+
4 rows in set (0.00 sec)

mysql> use mysql;//回车
Database changed
-> ;
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 ‘//回车’ at line 1
mysql> use mysql;
Database changed
mysql> select user,host from user;
±-----------------±----------+
| user | host |
±-----------------±----------+
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
±-----------------±----------+
4 rows in set (0.00 sec)

mysql> grant all privileges on . to ‘用户名’@‘192.168.1.1’ identified by ';
[1]+ 已停止 mysql -uroot -p
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 34
Server version: 8.0.28 MySQL Community Server - GPL

Copyright © 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> select User,Host from mysql.user;
±-----------------±----------+
| User | Host |
±-----------------±----------+
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
±-----------------±----------+
4 rows in set (0.00 sec)

mysql> grant all privileges on . to ‘用户名’@‘192.168.62.129’ identified by ‘111111’;
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 ‘identified by ‘111111’’ at line 1
mysql> ^C
mysql> ^C
mysql> check the manual that corresponds to your MySQL server version for the right syntax to use near ‘identified by ‘111111’’ at line 1
-> ;
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 ‘the manual that corresponds to your MySQL server version for the right syntax to’ at line 1
mysql> update user set host = ‘%’ where user =‘root’;
ERROR 1046 (3D000): No database selected
mysql> select User,Host from mysql.user;
±-----------------±----------+
| User | Host |
±-----------------±----------+
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
±-----------------±----------+
4 rows in set (0.00 sec)

mysql> update user set host = ‘%’ where user =‘root’;
ERROR 1046 (3D000): No database selected
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> use mysql;
Database changed
mysql> select Host,User from user;
±----------±-----------------+
| Host | User |
±----------±-----------------+
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
±----------±-----------------+
4 rows in set (0.00 sec)

mysql> update user set Host = ‘%’ where Host = ‘localhost’ & user = ‘root’;
ERROR 1292 (22007): Truncated incorrect DOUBLE value: ‘localhost’
mysql> GRANT ALL PRIVILEGES ON . TO ‘root’@‘%’ IDENTIFIED BY ‘111111’ WITH GRANT OPTION;
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 ‘IDENTIFIED BY ‘111111’ WITH GRANT OPTION’ at line 1
mysql> update user set Host = % where Host = localhost & user = root;
ERROR 1054 (42S22): Unknown column ‘localhost’ in ‘where clause’
mysql> update user set Host = ‘%’ where Host = ‘localhost’ & user = ‘root’;
ERROR 1292 (22007): Truncated incorrect DOUBLE value: ‘localhost’
mysql> SELECT version();
±----------+
| version() |
±----------+
| 8.0.28 |
±----------+
1 row in set (0.00 sec)

mysql> create user test@‘localhost’ identified by ‘123456’;
Query OK, 0 rows affected (0.13 sec)

mysql> grant all privileges on test.* to test@‘localhost’;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> grant all privileges on test.* to test@‘%’ identified by ‘123456’;
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 ‘identified by ‘123456’’ at line 1
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> update user set Host = ‘%’ where Host = ‘localhost’ & user = ‘root’;
ERROR 1292 (22007): Truncated incorrect DOUBLE value: ‘localhost’
mysql> GRANT ALL PRIVILEGES ON . TO ‘test’@‘%’ IDENTIFIED BY ‘123456’ WITH GRANT OPTION;
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 ‘IDENTIFIED BY ‘123456’ WITH GRANT OPTION’ at line 1
mysql> select Host,User from user;
±----------±-----------------+
| Host | User |
±----------±-----------------+
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
| localhost | test |
±----------±-----------------+
5 rows in set (0.00 sec)

mysql> create user test@‘localhost’ identified by ‘123456’;
ERROR 1396 (HY000): Operation CREATE USER failed for ‘test’@‘localhost’
mysql> create user test@‘localhost’ identified by ‘123456’;
ERROR 1396 (HY000): Operation CREATE USER failed for ‘test’@‘localhost’
mysql> create user itcast@‘%’ identified by ‘222222’;
Query OK, 0 rows affected (0.01 sec)

mysql> grant all privileges on itcast.* to itcast@‘%’;
Query OK, 0 rows affected (0.08 sec)

mysql> select Host,User from user;
±----------±-----------------+
| Host | User |
±----------±-----------------+
| % | itcast |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
| localhost | test |
±----------±-----------------+
6 rows in set (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> select host,user,plugin,authentication_string from mysql.user;
±----------±-----------------±----------------------±-----------------------------------------------------------------------+
| host | user | plugin | authentication_string |
±----------±-----------------±----------------------±-----------------------------------------------------------------------+
| % | itcast | caching_sha2_password | $A 005 005 005E]>~ndZ’5+2y
bztXwIdm0hkP1cuQNStKwz/RRyyxvcV2cNlW316qAZ4x. |
| localhost | mysql.infoschema | caching_sha2_password | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.session | caching_sha2_password | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.sys | caching_sha2_password | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | root | caching_sha2_password | $A$005$3hlc7Dz0J>k_k#k90AQvZfa55jO5D.7B/8xl/NWXoxcJzClbsM0COL1s. |
| localhost | test | caching_sha2_password | $A 005 005 005’\f
b4Cj*4:7ZJitBtLWRd4.xSYhW0lJdxmmIbcx4rpv6DSKuIB8VE02 |
±----------±-----------------±----------------------±-----------------------------------------------------------------------+
6 rows in set (0.00 sec)

mysql> ALTER USER ‘itcast’@‘%’ IDENTIFIED WITH mysql_native_password BY ‘222222’;
Query OK, 0 rows affected (0.10 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> create user itcast@‘%’ identified by ‘222222’;
ERROR 1396 (HY000): Operation CREATE USER failed for ‘itcast’@‘%’
mysql> alter user root@‘%’ identifiedd by ‘111111’;
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 ‘identifiedd by ‘111111’’ at line 1
mysql> create user root@‘%’ identified by ‘111111’;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on root.* to root@‘%’;
Query OK, 0 rows affected (0.00 sec)

mysql> select Host,User from user;
±----------±-----------------+
| Host | User |
±----------±-----------------+
| % | itcast |
| % | root |
| localhost | mysql.infoschema |
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
| localhost | test |
±----------±-----------------+
7 rows in set (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> select host,user,plugin,authentication_string from mysql.user;
±----------±-----------------±----------------------±-----------------------------------------------------------------------+
| host | user | plugin | authentication_string |
±----------±-----------------±----------------------±-----------------------------------------------------------------------+
| % | itcast | mysql_native_password | A0C1808B1A47CECD5C161FEE647F5427F4EB6F98 |
| % | root | caching_sha2_password | $A 005 005 005 MX.zybL:]%+(|g_SAG04DAeHUQ3nYTI4layGtJ9IZ20fLtmFMIxvyU86IA |
| localhost | mysql.infoschema | caching_sha2_password | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.session | caching_sha2_password | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | mysql.sys | caching_sha2_password | $A 005 005 005THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED |
| localhost | root | caching_sha2_password | $A$005$3hlc7Dz0J>k_k#k90AQvZfa55jO5D.7B/8xl/NWXoxcJzClbsM0COL1s. |
| localhost | test | caching_sha2_password | $A 005 005 005’\f
b4Cj
4:7ZJitBtLWRd4.xSYhW0lJdxmmIbcx4rpv6DSKuIB8VE02 |
±----------±-----------------±----------------------±-----------------------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> IED WITH mysql_native_password BY ‘222222’;
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 ‘IED WITH mysql_native_password BY ‘222222’’ at line 1
mysql> alter user ‘root’@‘%’ identified with mysql_native_password by ‘111111’;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all privileges on . to root@‘%’;
Query OK, 0 rows affected (0.01 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql>
连接断开
连接主机…
连接主机成功
Last login: Tue Dec 20 09:47:19 2022 from 192.168.62.127
[root@localhost ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 48
Server version: 8.0.28 MySQL Community Server - GPL

Copyright © 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql> show databases
-> ;
±-------------------+
| Database |
±-------------------+
| information_schema |
| mysql |
| performance_schema |
| qq |
| sys |
±-------------------+
5 rows in set (0.03 sec)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your 的相关文章

随机推荐

  • windows下安装使用git-lfs克隆大文件

    下载安装git lfs工具 首先去git lfs这里 下载相应平台的工具 我下载的windows版本 非安装版本 直接配置到系统环境变量里 执行以下命令验证是否成功 git lfs install 克隆数据集 这样自动会下载里边的大文件 g
  • 在vivado中使用tcl脚本(UG894)

    本文源自UG894 主要介绍如何在vivado中使用tcl脚本 1 vivado中如何获取tcl help vivado中任何自带的命令都可以通过 help 获取帮助信息 也可以直接输入 help 取得vivado命令合集 并通过 help
  • News Distribution(Codeforces 1167C) (并查集简单应用)

    并查集查询时间复杂度是O 1 合并时间复杂度才是O n 题意 n 人数 m 组数 m行 先输入k 表示这组有k个人 下面是k个人的编号 同组可以传递信息 问当第i个人是信息源时 有几个人知道信息 AC代码 include
  • 排序算法6-归并排序

    1 什么是归并排序 归并排序是建立在归并操作上的一种有效的排序算法 该算法是采用分治法 Divide and Conquer 的一个非常典型的应用 将已有序的子 序列合并 得到完全有序的序列 即先使每个子序列有序 再使子序列段间有序 若将两
  • 电路端接电阻与信号完整性

    信号沿着传输线传播时 每时每刻阻抗都可能发生变化 例如 PCB走线的宽度或者厚度发生变化 PCB过孔 PCB转角 PCB上的电阻 电容 电感 接插件和器件引脚都会产生阻抗变化 若走线的瞬时阻抗 只和传输线的横截面积和材质特性有关 发生变化
  • keil使用arm_math文件报错

    引入该文件后编译报错 application arm math h 306 error 35 error directive Define according the used Cortex cor 添加如下全局宏定义 USE HAL DR
  • 如何将任意数据保存到以太坊区块链?

    2019独角兽企业重金招聘Python工程师标准 gt gt gt 虽然有北大博士讲 95 的区块链项目都没有前途 但我们知道区块链还是有它的优势 比如数据的不可篡改性对于版权保护有相当大的意义 而地址的匿名性则有其他潜在的用途 那么 如何
  • TensorFlow、PyTorch 和 Keras

    1 可用的 RNN 类型 在寻找 NLP 问题的深度学习解决方案时 循环神经网络 RNN 是开发人员最流行的首选架构 因此 从这个角度来比较框架是有意义的 所有正在考虑的框架都具有允许我们创建简单 RNN及其更进化的变体的模块 门控循环单元
  • V4l2框架基础知识(二)

    V4L2对uvc USB video class 免驱usb设备的编程框架 主要用于采集USB摄像头 采集方式 打开视频设备 设置视频设备的属性 缩放 裁剪等 在linux编程中直接使用ioctl 函数对设备I O通道进行管理 V4L2操作
  • 一文看懂PPP协议——PPP协议简介

    今天给大家介绍一下PPP协议的相关内容 文章浅显易懂 特别适合0基础同学 本文主将主要从PPP概述 PPP链路建立过程和PPP认证三个角度对PPP协议进行讲解 一 PPP概述 PPP point to point协议 即点对点协议 是数据链
  • unity获取用户鼠标与键盘操作

    Unity鼠标键盘输入 代码写在Update 函数中 屏幕坐标的原点在屏幕的左下角 1 通过Input API 获得鼠标的操作信息 1 获得鼠标的坐标位置 Input mousePosition 2 检测鼠标按下 Input GetMous
  • oracle如何去列的重复,oracle重复列只显示一次的实现

    CREATE TABLE test ob id VARCHAR 32 ob name VARCHAR 32 INSERT INTO test VALUES A001 A001 a INSERT INTO test VALUES A001 A
  • YOLOE,2022年新版YOLO解读

    前言 这是2022年第一个关于YOLO的改版 该版本由百度提出 称之为YOLOE 是目前各项指标sota的工业目检测器 性能sota且部署相对友好 该检测器的设计机制包括 Anchor free无锚盒机制 可扩展的backbone和neck
  • Spring的工作原理(二)IOC-DI

    目录 Spring的工作原理 二 IOC DI 一 什么是IOC 什么是DI 1 1 IOC Inversion of Control 控制反转 1 2 DI Dependency Injection 依赖注入 二 IOC控制反转基础知识
  • 【Python】ChineseCalendar包简介

    ChineseCalendar 是一个 Python 包 用于获取中国传统日历信息 这个包提供了中国农历 二十四节气 传统节日 黄历等信息 你可以使用以下命令来安装这个包 pip install ChineseCalendar 安装完成后
  • iOS开发 将html加载到页面上

    记得要引入头文件 import WebKit WebKit h weakself myWebView WKWebView alloc initWithFrame CGRectMake 0 206 weakself view com widt
  • stm32入门自学笔记

    一 二极管 二极管是一种由半导体材料制成的一种具有单向导电性能的电子元器件 二极管就是由一个由 P 型半导体和 N 型半导体形成的 PN 结加上相应的电极引线及管壳封装而成的 NPN和PNP型三极管的作用 1 NPN三极管 基极加高电压 集
  • PRBS笔记

    1 概述 PRBS 伪随机二进制序列 也称为伪随机码 通常被用来测试高速信号的信号质量 伪随机 也说明了该码流并不是真正的随机 而是具有特性属性 码流由 多项式 决定 具有重复周期 PRBS具有多种阶数 如PRBS7 PRBS15 PRBS
  • reify:rxjs: timing reifyNode:node_modules/@vue/cli/node_modules——————npm run dev报错-npm初始化错误

    金钱不够 全靠技术 创建vue3的问题总结 reify rxjs timing reifyNode node modules vue cli node modules卡死不动 npm run dev报错 全局安装webpack 总结 rei
  • ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your

    以下是解决问题的过程 没整理 root localhost flush privileges bash flush 未找到命令 root localhost mysql uroot p Enter password Welcome to t