Quick SQL

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

The very basics

Connecting to MySQL

-OR-

When you’re in, you’ll see:

So how can I see all my databases?

What about all my users?

(this is the ‘user’ equivalent to SHOW DATABASES;)

What about making a new database?

Can I attach a new user to that database?

Wait, can we disect that?

What if I don’t want to grant all privileges?

How to create a user without attaching it to a database:

Attaching a prexisting user to a database:

So I have one user and want to assign it to every database…

I made changes but aren’t saving?

I don’t remember what grants I assigned!

OK, show me your tables

Start working in a database!

Show me more!

(Once you select a database, you can truncate your commands
as you no longer need to specify which database)

Show me MORE!

(Show everything from inside the table ‘users’)

So how do I EXPORT my database?

Cool.. now how do I IMPORT it?

1) Create the empty database first:

2) Import from shell:

(Be careful not to get < and > mixed up!)

Did it work?

The slightly more advanced

So I want to make a change in a database..

Whoa what is that UPDATE statement? Can we break that down?

So how do I add a new row?
(Note: This is all on one line)

This one is pretty easy to understand.

I change my mind, i don’t want that last user!

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.