我想从另一台网络下的计算机连接到SQL数据库,由于某种原因,在SQL控制台中它告诉我有一个语法错误,我尝试过以不同的方式输入它,但没有结果,我看不到哪里搞砸了 错误1064 (42000):您的SQL语法中有一个错误;请查看与您的MySQL服务器版本相对应的手册,以获得正确的语法,以便在第1行mysql>中使用near‘由'mypassword’标识,并使用GRANT OPTION‘ GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH
我想开始用MySQL编写查询。
show grants显示:
+--------------------------------------+
| Grants for @localhost |
+--------------------------------------+
| GRANT USAGE ON *.* TO ''@'localhost' |
+--------------------------------------+
我没有任何用户id,但是当我想创建一个用户时,我没有权限,而且我也不知道如何在没有一个用户的情况
我希望使用bash脚本运行mysql命令,但由于重音标记(`)而导致语法错误。
mysql -u root -p -e "GRANT ALL PRIVILEGES ON `testuser\_%` . * TO 'testuser'@'%';"
bash: testuser_%: command not found... Enter password: ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corres
我正在尝试使用PDO将csv数据导入到mysql中,并加载数据INFILE (我也尝试了LOAD data LOCAL INFILE),但我一直收到一个语法错误,我不知道为什么。文件路径和表名似乎是正确的。
下面是我使用的import()函数-
function import() {
$this->db = mydb::getConnection();
// set the column names for the selected journal table
if ($this->table = "bsp_journals") {
我正在尝试编写一个MySQL数据库(称为security_db.sql),其中我概述了一些有关安全保卫工作的表。代码本身在下面。对奇怪的格式很抱歉。
drop database if exists security;
create database security;
use security;
drop table if exists caller;
drop table if exists number;
drop table if exists officer;
drop table if exists suspect;
drop table if exists repo
在从SQL数据中删除数据时,我遇到了一个问题。我试过各种版本的发言,但都没有结果。下面是我收到的错误和我正在使用的声明。
$sql = "DELETE FROM `saved_holidays` WHERE (subscriberID= $user AND title= $check_value)";
//connect to database then execute the SQL statement.
$db->exec($sql);
错误信息是:
SQLSTATE42000:语法错误或访问冲突: 1064您的SQL语法出现了错误;请查看与MySQL服务器版本对
在新安装了ubuntu 20.04之后,使用root用户连接到mysql会出现错误。对于以下命令,请使用
sudo mysqld_safe --skip-grant-tables --skip-networking
mysql -u root
我收到语法错误,无法更新root密码:
Mysql版本:
mysql Ver 8.0.22-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))
命令:
update `user` set `authentication_string`=PASSWORD("") where `User`=
我尝试通过bash创建一个新的数据库,它的名称中有一个破折号。
这就是我尝试过的:
echo "CREATE DATABASE IF NOT EXISTS db-name CHARACTER SET utf8 COLLATE utf8_general_ci" | mysql -uuser -ppw
这将失败,并显示以下错误:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server versi
我正在将数据加载到存储过程中的一个表中,该存储过程的文件名作为参数传递。
select @load_config:= concat('load data local infile ',config_file,' into table config fields terminated by \',\' lines terminated by \n');
prepare stm from @load_config;
为此,我得到了一个错误
错误1064 (42000):您的SQL语法出现了错误;请检查与您的MariaDB服务器版本相对应的手册,
试过
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
获取
错误1064 (42000):您的SQL语法有一个错误;请检查与您的MySQL服务器版本相对应的手册,以获得在第1行使用“根”和GRANT选项附近使用的正确语法。
注意:在以前的版本中同样有效。
也试过
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH
在mysql 5.7主服务器上,下面的命令会生成语法错误。
CHANGE REPLICATION FILTER REPLICATE_DO_DB = ('mydb')
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 'REPLICATION FILTER REPLICATE_DO_DB = ('mydb
有件事巴什不喜欢。什么应该逃出来,怎么逃?
mysql --user=root --password=mypass vsftpd << EOF
GRANT ALL PRIVILEGES ON `MYUSERNAME\_%`.* TO 'MYUSERNAME'@'%';"
EOF
我得到以下错误:
-bash: MYUSERNAME_%: command not found ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual t
尝试使用通配符在多个表上授予用户select特权,如下所示:
GRANT SELECT ON 'DBname'.'foo_%' TO 'username'@'%' IDENTIFIED BY 'password';
但是,请继续给出以下错误:
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syn