I have an error creating a role in MySQL in Phpmyadmin - mysql

I ran this command
CREATE ROLE
kaitech_admin,
product_manager,
sales_manager,
customer_service_representative;
but phpmyadmin will just return an error saying "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax"
However, I also tried doing this:
CREATE ROLE
kaitech_admin;
but still i get the same error.
What should i do?

Related

How to resize mysql> innodb_temp_data_file_path = ibtmp1:12M:autoextend:max:5G;? Using Mysql 8.0

I tried to resize in many different ways but I always get the same error:
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 'innodb_temp_data_file_path=ibtmp1:12M:autoextend:max:500M' at line 1
As mysql manual on sysvar_innodb_temp_data_file_path says, it is not a dynamic variable, therefore cannot be set using set sysvar_innodb_temp_data_file_path=... method via sql. You need to include it either in your mysql config file or as a startup parameter to the mysql service.

Cannot create tables through PopSQL - ER_PHRASE_ERROR

I'm completely new to SQL and trying to learn online. I'm trying to create tables in MySQL through PopSQL, but I keep getting a syntax error. Not sure what I'm doing wrong. Picture attached for reference. Any help will be appreciated.
My query is:
CREATE TABLE studentinfo ();
And the error I get when trying to run it is:
ER_PARSE_ERROR: 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
Link for reference

I can't read a database on mysql because of wrong syntax in the database name, but the database reads on other platforms like DBmaria

Hi please I am new to mysql and I'd love to know how to access a database with the name 'c-factory'. It seems mysql does not read it because of the '-' sign. I've been able to load it on dbmaria but I don't seem to be able to do it with mysql
SELECT * FROM c-factory
Error Code: 1064. 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 '-factory' at line 4 0.000 sec```

MySQLSyntaxErrorException: You have an error in your SQL syntax (Spring Hibernate)

I'm just trying to run this tutorial project: https://spring.io/guides/gs/accessing-data-mysql/
Doing the same, but getting an error:
MySQLSyntaxErrorException: 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
What could be wrong here?
I'm using MySQL 8.0.15, SpringBoot 5, IntelliJ Idea

Is there a way to enable MySQL to explain syntax error in more details?

MySQL only gives an unhelpful error message when it encounters a grammar or syntax error:
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 .......
Is there any way to let MySQL to explain syntax error (e.g. expecting closing parenthesis, illegal expression, etc) in details?
The answer is - no. All server errors messages and their codes are listed in the documentation.
Server Error Codes and Messages.
From the documentation - For error checking, use error codes, not error messages. Error messages do not change often, but it is possible.
About the syntax errors: if there are no more specific error codes, then you get Error: 1149 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax...
As a work around: You can view all syntax errors in dbForge Studio for MySQL. Create new SQL document and write some code, or just open SQL-file, automatic SQL syntax check will highlight errors in the code.
Automatic SQL syntax check feature.
This feature is available in Professional and Enterprise editions, but you can try it on trial version.