|
Replies:
6
-
Pages:
1
-
Last Post:
Mar 12, 2013 7:50 PM
by: vnk515
|
Threads:
[
Previous
|
Next
]
|
|
Posts:
2
Registered:
11/10/10
|
|
|
|
Total Beginner!
Posted:
Nov 10, 2010 1:55 PM
|
|
|
Hi,
I downloaded MySql and Toad for MySql specifically so I could improve my sql querying skills at home, away from the office.
So, I need to import some sample databases and or create my own in order to run my queries.
Can anyone tell me the simplest way of doing this? I need any database really - that I can use to practice on.
Sorry to be a bit vague. If someone can point my in the right direction - great. So to recap I need:
1. Find some sample databases I can use (any) 2. Import these into MySQL (how?) 3. Connect to database through Toad (again - not clear on this) 4. Open Sql window for running queries
Thanks in advance
|
|
|
Posts:
20
Registered:
2/16/10
|
|
|
|
Re: Total Beginner!
Posted:
Nov 10, 2010 4:58 PM
in response to: bart100
|
|
|
Steve,
You want to download the Sakila database for MySQL. Install and download details are available at: http://dev.mysql.com/doc/sakila/en/sakila.html
I assume you have already installed MySQL. If not, you can download the community edition from: http://dev.mysql.com/downloads/mysql/
Linda
|
|
|
Posts:
2
Registered:
11/10/10
|
|
|
|
Re: Total Beginner!
Posted:
Dec 3, 2010 6:18 AM
in response to: Linda
|
|
|
Linda, thanks for the reply.
I'm still a bit stuck. Not sure how to open the MySQL Command Line client to run the sakila-schema.sql. I don't know what my MySql password is. Can I do any of this from within the Toad client?
It's step 2 here I'm stuck with : http://dev.mysql.com/doc/sakila/en/sakila.html
Many thanks in advance
|
|
|
Posts:
20
Registered:
2/16/10
|
|
|
|
Re: Total Beginner!
Posted:
Dec 6, 2010 5:50 PM
in response to: bart100
|
|
|
Steve,
You can do this from within the Toad client, although at some point you will need to know what the password actually is. If you didn't set anything, it may still have a blank root password.
If you need to reset the root password, follow the instructions in the manual at: http://dev.mysql.com/doc/refman/5.1/en/resetting-permissions.html
You can open the Sakila SQL files in the Toad Editor and press F5 to run the entire script in one go. Make sure you run the schema script first, then the data script.
Linda
|
|
|
Posts:
2
Registered:
12/21/10
|
|
|
|
Re: Total Beginner!
Posted:
Dec 21, 2010 6:47 AM
in response to: Linda
|
|
|
Dummy questions:
how do you open the command line from the toad client? There's an editor...but it can't seem to take any commands... I tried to open a connection...it requires user name and password... wrote somethin' there... nothing is working...so...anyone can tell me step by step how this actually works?
|
|
|
Posts:
1
Registered:
12/21/10
|
|
|
|
Re: Total Beginner!
Posted:
Dec 21, 2010 6:06 PM
in response to: Beginner
|
|
|
I'm going under the assumption that you have the database already in hand from Linda's source.
You don't need to open any MySQL command line. The purpose of having Toad is to replace the command line with a more simple GUI tool.
1. You need to first create a connection from Toad to MySQL. Click on the Create new connection button in the Connection Manager. You need to enter "host", "username", and "password". You can leave everything else alone. (the "host" is the machine running the MySQL server. If this is your local machine, then leave it as "localhost"). The click connect. This will establish a connection to MySQL server
2. Once the step 1 is done, Click on the Open File button and open your SQL file. I'm giong under the assumption that you have some filename.sql. From the sound of thing, you have one for the schema (which is basically the structure of the database), and second file for the data. Open the schema file first.
3. This should open an editor with bunch of SQL commands. You need to run all the commands. You can run them all at once by pressing the F5 key.
4. Once step 3 is done, repeat step 2 and 3 with the data file.
At this point you should have the database with data loaded.
Now if you want to run some SQL commands, you first want to open an Editor. Click on the button that says "Edit SQL". This will open a new window. Enter any commands in the editor. You can run the command by pressing the F5 or F9.
Message was edited by: namhee
|
|
|
Posts:
1
Registered:
3/12/13
|
|
|
|
Re: Total Beginner!
Posted:
Mar 12, 2013 7:50 PM
in response to: namhee
|
|
|
Hi Namhee, When I try to create a new connection, I get the error "Access denied for user '(username)'@'localhost' (using password: YES)" Where am I going wrong?
|
|
|
|
Legend
|
|
Guru: 2001
+
pts
|
|
Expert: 751
- 2000
pts
|
|
Enthusiast: 31
- 750
pts
|
|
Novice: 0
- 30
pts
|
|
Moderators
|
|
Helpful answer
(5 pts)
|
|
Answered
(10 pts)
|
|