1

I used MySQL through command line in order to create a database named javafxsample. The code is as folls:

create database javafxsample;
use javafxsample;

create table if not exists user(
    id int(11) not null auto_increment,
    username varchar(255) not null unique,
    last_name varchar(255) not null,
    first_name varchar(255) not null,
    password varchar(255) not null,
    created_at datetime not null default current_timestamp,
    primary key(id)
); 

The database javafxsample is created successfully in MySQL command line. (I know this because I can see it using SHOW DATABASES;.) However, when I try to see it using DESCRIBE javafxsample;, I got this error message:

ERROR 1146 (42S02): Table 'javafxsample.javafxsample' doesn't exist.

I do not know how to solve this issue, nor why I can not see the table javafxsample. I am using MySQL server version 5.7.24. Any help or suggestion(s) in order to get this table work is really appreciated.

Agi Hammerthief
  • 2,114
  • 1
  • 22
  • 38
  • @Simonare has mentioned the resolution to the error. You also need to consider giving a valid and better name to your table. Check https://stackoverflow.com/questions/5290609/what-is-the-best-practice-in-naming-your-user-table – J. P Mar 13 '19 at 07:29

2 Answers2

3

javafxsample is your database. you cannot use describe on database.

Try describe user instead

Derviş Kayımbaşıoğlu
  • 28,492
  • 4
  • 50
  • 72
1

The error "ERROR 1146 (42S02): Table 'javafxsample.javafxsample' doesn't exist" says table "javafxsample" does not exists in "javafxsample" database.

You create database "javafxsample" and table "user".

So try describing your user table like DESCRIBE user

Santosh
  • 874
  • 11
  • 21