Uber-Newb MySQL question

pfgannonpfgannon ModeratorAdministrator
Ok, so I'm trying to learn MySQL,PHP, and Apache from this book.

In the MySQL section with out much explanation goes into the syntax of stuff.
But where do I input this syntax? I'm guessing through the DB monitor but where exactly?

Comments

  • martian2k4martian2k4 Llama Hunter Moderator
    I take it you have cPanel yes?

    Make a new Database and add a user to it. Then you can connect with that info. Then you can goto PHPMyAdmin were you can use the "Wizard" to build up the fields or you can run querys on the database through the little tab at the top that says SQL.

    Hope it helps :D
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • strangedarstrangedar Senior Member The Royal RAM
    Which book are you using? If your using php and mysql for dummies then it gives a URL to a file you can use but I'm sure your smart enough to se that. If you aren't using that book (which I presume you not) then you could still use the file you can get it from http://janet.valade.com/download2.html and its called mysql_send.php. You need to place it in the directory where you're developing your web application and type MySQL querys into the box... Simple :D
    strangedarknesssig.jpg
    sebastianastill.co.uk - My Portfolio
  • strangedarstrangedar Senior Member The Royal RAM
    myadmin and that file I linked to will wpork locally..
    If you want to do it using the monitor I'll tell ya, give me a minute though... :D
    *starts typing instructions...*
    strangedarknesssig.jpg
    sebastianastill.co.uk - My Portfolio
  • strangedarstrangedar Senior Member The Royal RAM
    1. Locate the mysql client.
    By default, the mysql client program is installed in the subdirectory bin, under the directory where MySQL was installed. In Unix/Linux, the default is /usr/local/mysql/bin or /usr/local/bin. In Windows, the default is c:\mysql\bin. However the client might have been installed in a different directory.

    2. Start the client
    In Unix/Linux, type the path/filename (for example, /usr/local/mysql/bin/mysql). In Windows, open a comman prompt window and then type the path/filename (for example, c:\mysql\bin\mysql.exe). Press enter after typing the path/filename unless you're using the paramaters shown in Step 3.

    3. If you're starting the mysql client to access a database acros the network, use the following parameters after the mysql command:

    -h host:host is the name of the machine where MySQL is located.
    -u user:user is your MySQL account name
    -p: This parameter prompts you for the password for your MySQL account.

    For instance, if you're in the directory where the mysql client is located, the command might look like this:

    mysql -h mysqlhost.mycompany.com -u root -p

    Press enter after typing the command.

    4. Enter your password when prompted for it.
    The mysql client starts, and you see something similar to this:
    Welcome to the MySQL monitor. Commands end with ; or \g.
    Your MySQL connection id is 459 to server version: 4.0.13
    Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
    mysql>

    5. Select the database that you want to use.
    At the mysql prompt enter the following:

    use databasename

    Use the name of the database that you want to query.

    6. At the mysql prompt, type your SQL query, followed by a semicolon (;), and then press Enter.
    The mysql client continues to prompt for input and does not execute the query until you enter a semicolon. The response to the query is displayed onscreen.

    7. To exit typ 'quit' at the prompt and then press Enter.
    strangedarknesssig.jpg
    sebastianastill.co.uk - My Portfolio
  • strangedarstrangedar Senior Member The Royal RAM
    Oops forgot to mention my source was PHP and MySQl For Dummies by Janet Valade. Dont want to have a lawsuit against me or anything ;) :D
    strangedarknesssig.jpg
    sebastianastill.co.uk - My Portfolio
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    fourtone87, you should go get a gui based client... working from the command prompt will be a nightmare...

    go to www.mysql.com and download the query analyzer and connect that to your database... then type in the commands/syntax in a window to test out your skills...
  • strangedarstrangedar Senior Member The Royal RAM
    daboss wrote:
    fourtone87, you should go get a gui based client... working from the command prompt will be a nightmare...
    It's faster though...
    strangedarknesssig.jpg
    sebastianastill.co.uk - My Portfolio
Sign In or Register to comment.