You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/13 14:17:49 UTC
[GitHub] [shardingsphere] zzsoszz opened a new issue, #22153: You have an error in your SQL syntax: ADD RESOURCE
zzsoszz opened a new issue, #22153:
URL: https://github.com/apache/shardingsphere/issues/22153
## Bug Report
mysql> ADD RESOURCE ds01 (
-> host=127.0.0.1,
-> port=13306,
-> db="my_database",
-> user="root",
-> password="my_root_password"
-> )
-> ;
ERROR 12000 (42000): You have an error in your SQL syntax: ADD RESOURCE ds01 (
host=127.0.0.1,
port=13306,
db="my_database",
user="root",
password="my_root_password"
), no viable alternative at input 'ADD' at line 1, position 0, near [@0,0:2='ADD',<78>,1:0]
### Which version of ShardingSphere did you use?
```
mysql> select version();
+-----------------------------------+
| version() |
+-----------------------------------+
| 5.7.22-ShardingSphere-Proxy 5.2.1 |
+-----------------------------------+
1 row in set (0.04 sec)
```
### mysql client version
```mysql --version
mysql Ver 8.0.31-0ubuntu0.20.04.1 for Linux on x86_64 ((Ubuntu))
```
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
add resource sucessed;
### Actual behavior
no viable alternative at input 'ADD' at line 1, position 0, near [@0,0:2='ADD',<78>,1:0]
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
```server.yaml
authority:
users:
- user: root
password: root
- user: sharding
password: sharding
privilege:
type: ALL_PERMITTED
rules:
- !TRANSACTION
defaultType: XA
providerType: Atomikos
- !SQL_PARSER
sqlCommentParseEnabled: true
props:
max-connections-size-per-query: 1
kernel-executor-size: 16 # Infinite by default.
proxy-frontend-flush-threshold: 128 # The default value is 128.
proxy-hint-enabled: true
sql-show: false
check-table-metadata-enabled: false
# Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
# The default value is -1, which means set the minimum value for different JDBC drivers.
proxy-backend-query-fetch-size: -1
proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
# Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution
# if client connections are more than proxy-frontend-netty-executor-size, especially executing slow SQL.
proxy-backend-executor-suitable: OLAP
```
``` start proxy
shardingsphere-proxy/bin/start.sh
```
``` connect to server
mysql -h127.0.0.1 -P3307 -uroot -proot
```
```
ADD RESOURCE ds01 (
host=119.23.110.179,
port=13306,
db="my_database",
user="root",
password="my_root_password"
);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #22153: You have an error in your SQL syntax: ADD RESOURCE
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #22153:
URL: https://github.com/apache/shardingsphere/issues/22153#issuecomment-1317129310
@zzsoszz I think the issue has been solved, I will close it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang commented on issue #22153: You have an error in your SQL syntax: ADD RESOURCE
Posted by GitBox <gi...@apache.org>.
RaigorJiang commented on issue #22153:
URL: https://github.com/apache/shardingsphere/issues/22153#issuecomment-1313122596
Hi @zzsoszz
`host` is a string, it needs to be wrapped in quotes.
> host="119.23.110.179"
Please refer to the document of DistSQL: https://shardingsphere.apache.org/document/5.2.1/en/user-manual/shardingsphere-proxy/distsql/syntax/rdl/resource-definition/
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] RaigorJiang closed issue #22153: You have an error in your SQL syntax: ADD RESOURCE
Posted by GitBox <gi...@apache.org>.
RaigorJiang closed issue #22153: You have an error in your SQL syntax: ADD RESOURCE
URL: https://github.com/apache/shardingsphere/issues/22153
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org