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 trialClaus Meyer
Courses Plus Student 2,523 PointsProblems with Mysql file (1046 - No database selected)
Error SQL query:
CREATE TABLE sizes
(
id
INT( 11 ) NOT NULL AUTO_INCREMENT ,
size
VARCHAR( 32 ) COLLATE utf8_unicode_ci DEFAULT NULL ,
order
INT( 11 ) NOT NULL ,
PRIMARY KEY ( id
)
) ENGINE = INNODB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci AUTO_INCREMENT =5;
MySQL said: Documentation
1046 - No database selected
No good, if you get problems just importing a file!
Problem is that I cant write "Create table"
1 Answer
Petros Sordinas
16,181 PointsYou have to tell SQL which database you are using
Either : USE database_name;
or if the database does not exist CREATE DATABASE database_name USE database_name;
Claus Meyer
Courses Plus Student 2,523 PointsClaus Meyer
Courses Plus Student 2,523 PointsTHANKS, I got it to work now...
Oki, my database name is: movikcrewhunter
USE movikcrewhunter; CREATE TABLE
sizes
(id
int(11)