The goal was to continue working on a project in the Java language that uses the database.
The course of action:
1. Install MySQL Community Server and IntellJ IDEA.
2. Creating a test pattern in MySQL Workbench and creating a test table there. Everything went well.
3. Configuring IDE from DB.
4. Import database dump into MySQL Workbench.
5. Import project in Java in IDE.
6. Compilation of the project and launching, testing the operation of the application from the database. Passed successfully.
7. Attempting to create a new table next to an existing one, receiving an error:

Operation of the SQL script to the database.
Executing:
CREATE TABLE test . new_table ();

ERROR 1064: You have an error in your SQL syntax; check my server for syntax to use right ')' at line 2
SQL Statement:
CREATE TABLE test . new_table ()

8. Creating a new test scheme, not related to the project, an attempt to create a test table there. Also the same error.

What could be the problem? Operations of viewing records in tables, adding a new record occur without problems.

    1 answer 1

    In fact, everything is written in the MySQL response.

    You have a syntax error.

    You have an error in your SQL syntax; check my server for syntax to use right ')' at line 2

    For clarity, I decided to test your request and reproduce the error ... and yes! .. it is absolutely similar to yours.

    The error states that something is wrong with you near the closing bracket and that you need to verify your request with the documentation.

    Question: What could be there?

    We go to the documentation and look at the syntax of the CREATE request:

     CREATE TABLE table_name ( column_name1 data_type(size), column_name2 data_type(size), column_name3 data_type(size), .... ); 

    It shows that MySQL expects that there will be a description of the table fields between the brackets, which are not present and that he considers an error.

    Let's try to add a field:

     CREATE TABLE `test`.`new_table` ( `id` INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (`id`) ); 

    And everything works fine!

    You need to add a description of the fields in the query.

    Your request is invalid.

    Regarding the creation of the scheme, I can only say one thing:

    Give your request and error message!

    I suspect that the answer lies precisely in them!

    Learn to read error messages! As a rule, they reflect the essence of the problem.

    • For some reason, the area in which columns are created is hidden (well, if you use a graphical interface), and I forgot about it .. If you can, another question, it arose. Not sure how to restart the mysqld.exe process? If you kill him manually, and then try to start, the console appears, then quickly closes and the process does not start. If you restart the computer, the process starts itself and everything is fine. But I want to somehow simplify it. - Rob
    • @Rob, if you are working under Windows, go to the task manager, go to the services tab, find MySQL and restart. Under Linux, as a rule, something like service mysqld restart in the console (the specific syntax depends on the distribution) - Mikhail Rebrov
    • @Rob, in Java code you will not have a graphical interface. Learn the syntax and practice in Workbench. Believe with practice it is not long and is remembered for a lifetime. - Mikhail Rebrov
    • @Rob, you can also restart the MySQL server in Workbench. Server tab on the main panel at the top and there is the Startup / Shutdown point - Mikhail Rebrov