Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialFilipe Pacheco
Full Stack JavaScript Techdegree Student 21,416 PointsError Code: 1006. Can't create database
I'm trying to create a database on workbench, but I keep getting this message. Tried searching in google, but they all give complicated terminal commands that I don't how to use in this situation. What can I do?
3 Answers
Andrew Winkler
37,739 PointsYou're using MySQL, correct? If you're using the command line you can use:
CREATE DATABASE your_database_name;
Then to use the database:
USE your_database_name;
Then you can create a table:
CREATE TABLE your_table (
id bigint unsigned PRIMARY KEY auto_increment,
name varchar(50) NOT NULL,
description text,
modified_on timestamp
) ENGINE = InnoDB;
Then you can populate the table:
INSERT INTO your_table (name, description)
VALUES ('Filipe', 'You are awesome');
Then you can select your table to do stuff:
SELECT * FROM your_table;
If commands do not work, something has been configured improperly. In that case I'd advise searching for a beginner YouTube video featuring a step-by-step walk through of how to get things going.
Filipe Pacheco
Full Stack JavaScript Techdegree Student 21,416 PointsThanks for the response. I just reinstalled Mysql and it's working now.
Andrew Winkler
37,739 Pointsyayyyyy
Steven Parker
231,261 PointsSteven Parker
231,261 PointsWhat's your DDL look like?