Can't create new columns, constraints, indexes using DBeaver 7 in MySQL 8

Viewed 7451

I'm attempting to create new tables and add new columns to an existing MySQL 8 database. I'd like to use DBeaver GUI for this task. Creating the new connection with the MySQL 8+ driver, I'm able to connect to my localhost using root user. I'm able to load the database tables and explore their columns, constraints, properties, etc. But I'm not able to create new columns... I can't see any option similar to New column, New Table, etc. In MySQL Workbench, for example, one just has to right-click over the grid to be able to add new columns.

I've right-clicked everywhere and I've read all menus and I'm not able to find a way to insert something new using the GUI. It seems as if I was in a read-only connection. However, I didn't check Security: Read-only connection when creating the connection (double checked).

Under table properties, if I right-click and I select Generate SQL > INSERT I'm not able to type anything in the resulting window... Testing my connection I got the following:

Connected (30 ms)
Server: 
MySQL 8.0.21
Driver: 
MySQL Connector/J mysql-connector-java-8.0.17 (Revision: 16a712ddb3f826a1933ab42b0039f7fb9eebc6ec)

Finally, in table properties, if I change the table description, click de Save button and then the Persist button, I'm able to update the description. What am I doing wrong then?

I'm missing something obvious for sure. Thanks in advance.

3 Answers

You can make changes to your tables with SQL. Click on the 'New SQL Editor' button here:

DBeaver's 'New SQL Editor' Button

Then type up your SQL:

ALTER TABLE db_name.my_table, 
    ADD COLUMN column_1 NULL,
    ADD COLUMN column_2 TEXT,
    ADD COLUMN first_name VARCHAR(255); 

Make sure you check the syntax for your specific version of MySql, and when you've got what you want there, click the 'Execute SQL Script' button:

DBeaver's 'Execute SQL Script' button

That should do the trick.

Running on Linux but seeing the same issue. I was able to start adding columns in the left pane, in the Database Navigator. Open a table, then right mouse on a table and you will see the option to add a column. Thereafter you can add columns in the properties tab.

Checked on windows machine on DBeaver 21.3.2, right the respective table on which you want to add column, click on "create column" and then enter the name and default values of the column like Auto increment and not null etc.

Finally click save and persist those changes in the database if you are sure of the changes you did otherwise edit the column and then persist them.

Related