#!/bin/bash
mysql.server start
mysql -u root << EOF
SET PASSWORD FOR [email protected]'localhost' = PASSWORD(‘admin’);
EOF
更改用户密码,但我得到以下错误: -
ERROR 1064 (42000) at line 1: 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 '‘admin’)' at line 1
不是set密码时应的命令,如果用别的东西会像如果我使用“创建数据库数据库名称”将会作品。
。
Update1:
如果我使用“管理员”或“管理员”而不是“管理员”,我得到了以下错误。
ERROR 1064 (42000) at line 1: 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 '“admin2”)' at line 1
。
Update2:
当使用-e标志我有以下错误
./mysql.sh: line 3: syntax error near unexpected token (' ./mysql.sh: line 3: mysql -u root -padmin -e “SET PASSWORD FOR [email protected]'localhost' = PASSWORD(‘admin2’);”'
+0
'“admin''你能在这些报价包装?尝试'“管理员”'或''admin''代替 –
+0
感谢回答,我认为问题是由于编辑:) –