SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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'

  2. #2
    SitePoint Addict D3V4's Avatar
    Join Date
    May 2010
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tappiocca View Post
    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?

    Code:
    mysql -u root -p 'password'

  3. #3
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.

  4. #4
    SitePoint Addict D3V4's Avatar
    Join Date
    May 2010
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tappiocca View Post
    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.

  5. #5
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by D3V4 View Post
    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?

  6. #6
    SitePoint Addict D3V4's Avatar
    Join Date
    May 2010
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tappiocca View Post
    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.

  7. #7
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by D3V4 View Post
    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:

    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


  8. #8
    SitePoint Addict D3V4's Avatar
    Join Date
    May 2010
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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).

  9. #9
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tappiocca grabs gun and kills self for being stupid!

    Thanks for that...!

  10. #10
    SitePoint Addict D3V4's Avatar
    Join Date
    May 2010
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by tappiocca View Post
    Tappiocca grabs gun and kills self for being stupid!

    Thanks for that...!
    Ahaha you're welcome

  11. #11
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by tappiocca View Post
    the book shows 3 dots stacked, not 2. I have never seen this character before.
    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
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  12. #12
    SitePoint Addict D3V4's Avatar
    Join Date
    May 2010
    Posts
    370
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    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.

  13. #13
    SitePoint Zealot
    Join Date
    Apr 2011
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    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 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.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •