Creating a Basic Database

Ok, now that I have the password issues dealt w/ more or less, I am trying to create a database. I am copying the commands straight from my book; I type this:
mysql> CREATE DATABASE ijdb;

and I get this:
ERROR 1044 (42000): Access denied for user ‘’@‘localhost’ to database ‘ijdb’

Are you accessing as root?


mysql -u root -p 'password'

Another question. The book give me a command line:
mysql> CREATE TABLE table_name (
-> column1Name column1Type column1Details,
-> column2Name column2Type column2Details,
-> : <-----
-> ) DEFAULT CHARACTER SET charset;

But on the fourth line where I have : the book shows 3 dots stacked, not 2. I have never seen this character before.

It means that there are more rows after the first two, but you don’t know their exact number.

Does that mean that I ignore that line in the book… or am I supposed to add it?

Yes, you can ignore it, meaning that if you want to add some more rows you can do it, otherwise you can stop before the dots.

Ok… Ignoring the 3 dots issue I type:

mysql> CREATE TABLE table_name (
-> column1Name column1Type column1Details,
-> column2Name column2Type column2Details,
-> ) DEFAULT CHARACTER SET charset;

and I get this error msg:
[I]
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘column1Type column1Details,
column2Name column2Type column2Details,
) DEFAULT CH’ at line 2

[/I]

You need to enter actual types and character sets. If column1 must contain an integer, you need to write INT, if it’s a date you have to write DATE etc.

Same thing for CHARACTER SET, you need to choose one (for example: UTF-8).

Tappiocca grabs gun and kills self for being stupid!

Thanks for that…!

Ahaha you’re welcome :smiley:

it’s a vertical ellipsis

it’s somewhat surprising to see how many people get hung up on this

we’ve had numerous threads here on sitepoint about it, because it’s used in sitepoint books as well

I don’t know why, I’m just guessing here, but maybe they are not spaced enough from the line before and the one after them, and people mistakenly think that they are a part of the statement. Again, just guessing.

I am actually using a Sitepoint book: Build Your Own Database Driven Web Site Using PHP & MYSQL, Author: K. Yank 4th Ed.

I have seen the “…” which pretty much means more to come, I usually use it in the ect ect…, it’s just I had never seen the vertical version, nor do I know how to create it.