mint jelly

User Been mySquirrel

um, i’m a novice when it comes to mysql where i’m not just tapping into pre-existing stuff.

trying to set up a db on my server space with dreamhost, doing a tutorial… with the goal of playing with php & mysql. Following these instructions, “Copy and paste the following text to a file and save it in MySQL’s bin directory.”

Where can I find the bin directory? “which” shows me only
“usr/bin/mysql”

but um… help? Am I jumping the gun? this says nothing of the mysql config so perhaps it’s not set up properly for/by me yet.

I do *have* mysql in my host’s package so it’s at my fingertips if I can figure this out.

if anyone can point me a little further, I’d be much obliged.

Posted by mia on 10/14 at 11:47 AM

  1. Hey: The instructions are generally correct, but you don’t need to put the SQL file into the bin directory. Just create a directory for your SQL files somewhere under your home directory.


    quagmire:# mkdir sql
    quagmire:# vi sql/file.sql


    The first two lines of the SQL file should look like the ones here. Disregard the word “zero”, that’s from the name of the project this sql file came from:


    create database zero;
    use zero;
    create table zero_usertable (
    user_id int primary key not null,
    firstname varchar(30),
    lastname varchar(30),
    job_title varchar(30),
    username varchar(20),
    password varchar(20)
    );


    Assuming this file is in the sql subdir, named file.sql, this should work. Note that ‘root’ listed below is a mysql username. On your system your account name is probably the same as your Unix username. However, mysql users are different from regular accounts, the main implication being that the passwords are not neccessarily the same.


    quagmire:# cd sql
    quagmire:# mysql -u root -pYourPasswd > file.sql
    -or-
    quagmire:# mysql -u You -pYourPasswd > file.sql


    Also confusing is the fact that mysql wants the password immediately following the -p flag, without spaces. Anway, you can put the sql file wherever and run mysql against it to create your database.

    Posted by kurt1992  on  10/14  at  06:01 PM

  2. wow, fabulous. i’ll give this a go. rock house.

    Posted by mia  on  10/14  at  06:12 PM

  3. Page 1 of 1 pages

Name:

Email (not required):

Location:

URL:

Smileys

Remember your personal information? Email not required.

Notify you of follow-up comments?

Submit the word you see below. If you preview and come back, you must refresh this page and enter a new word.


Next entry: Commercial

Previous entry: Howls

<< Back to main