PDA

توجه ! این یک نسخه آرشیو شده می باشد و در این حالت شما عکسی را مشاهده نمی کنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : آموزش ساده تصویری راه اندازی MySQL



TAHA
11-26-2009, 11:22 PM
آموزش ساده تصویری راه اندازی MySQL

http://pnu-club.com/imported/mising.jpg (http://www.15seconds.com/issue/050210.htm)

براي مشاهدي ادامه آموزش روي عكس بالا كليك كنيد

TAHA
11-26-2009, 11:23 PM
http://pnu-club.com/graphics/issue/050210_02.gif
http://pnu-club.com/graphics/issue/050210_03.gif
http://pnu-club.com/graphics/issue/050210_04.gif
As you can see in the screen capture above, at the end of the setup process the installer asks if you'd like to configure the MySQL Server. If you choose to do so, it will launch the MySQL Server Instance Configuration Wizard which brings us to the next step in the process.
Step 2 - Configuration
The MySQL Server Instance Configuration Wizard makes configuring your server really simple. Configuration is straight forward and I just used the default setting for most everything.
http://pnu-club.com/graphics/issue/050210_05.gif
http://pnu-club.com/graphics/issue/050210_06.gif
If your're installing on a dedicated database server or a shared server you should obviously select the appropriate choice. Since I'm installing on my laptop, I simply left the server type as "Developer Machine". This setting won't offer the same performance, but it also won't use as many system resources.
http://pnu-club.com/graphics/issue/050210_07.gif
http://pnu-club.com/graphics/issue/050210_08.gif
I made sure to enable TCP/IP networking in order to allow the web server to connect to the database when we get to building a web page to query the database. If you'll be running the database and web servers on the same physical computer then you can disable this option to prevent access to the database via the network.
http://pnu-club.com/graphics/issue/050210_09.gif
http://pnu-club.com/graphics/issue/050210_10.gif
http://pnu-club.com/graphics/issue/050210_11.gif
http://pnu-club.com/graphics/issue/050210_12.gif

Step 3 - MySQL Administrator
While it's certainly not required, I highly recommend you download and install the MySQL Administrator (http://www.mysql.com/products/administrator/). It's a great little application that provides a GUI to help you manage your new database server. While you can get up and running using only the command line, for users who are used to using Windows applications and wince at the thought of editing configuration files by hand or using a command prompt it's almost a necessity. For the rest of this article, I'll assume you've installed MySQL Administrator and I'll be using it for illustration.
http://pnu-club.com/graphics/issue/050210_14.gif

Step 4 - Creating a Database
In order to create our database, we first need to connect to the server. Run MySQL Administrator and login to your server using the password you set during installation.
http://pnu-club.com/graphics/issue/050210_15.gif
You'll then want to select the "Catalogs" item at the bottom left of the MySQL Administrator window. This should bring up a list of the current databases on the server (There should be two of them: "mysql" and "test"). If you right-click in the small window where they are listed you should get the option to "Create New Schema".
http://pnu-club.com/graphics/issue/050210_16.gif
You'll then be prompted to enter a name for the new database. I'll be using "mydatabase" as the example for the remainder of this article.
http://pnu-club.com/graphics/issue/050210_17.gif
Once created, your new database will appear in the Schemata list along with the other databases on the server. Selecting it from this list will bring up its details in the right hand pane.
http://pnu-club.com/graphics/issue/050210_18.gif
There's not much to see because the database is still empty... so let's put something in it.

Step 5 - Creating a Table
To create a table simply click on the "Create Table" button. This brings up the following dialog box:
http://pnu-club.com/graphics/issue/050210_19.gif
As you can see, I've named the table "mytable" and added 4 fields to it: an auto-incrementing primary key id field, an integer field, a text field, and a date/time field.
When you're done making changes, you simply click the "Apply Changes" button. A window that looks something like the one below will pop up showing you the SQL that will be executed and asking you to confirm that you want to save changes to the table design.
http://pnu-club.com/graphics/issue/050210_20.gif
At this point, we've got a database named "mydatabase" that contains a table named "mytable". Now all we need is to add some rows of data to the table.

Step 6 - Adding Data
In the real world, data in your table would probably come in via your application. To get some sample data into our table, I'm simply going to insert a few lines by hand. To do this I'll use the MySQL Command Line Client. If you're still in the MySQL Administrator you can access the command line from the "Tools" menu (Tools -> MySQL Command Line Client) otherwise you can run it from the MySQL group on the Start Menu.
http://pnu-club.com/graphics/issue/050210_21.gif
The first command in the screen above tells the server which database I want to be working in. The second and third commands simple insert some dummy data and are the same except for the the differences in the data being inserted.
Now we've got two sample rows of data in our table. At this point our database server is up and running with a database, a table and even some data.

Conclusion
This article illustrated how to do the following:


Download and install the MySQL Database Server.
Configure the server.
Install MySQL Administrator to make managing the database easier.
Create a new database named "mydatabase".
Create a new table named "mytable" in that database.
Add a couple rows of sample data to that table.

Next time we'll look at adding users to the database server, the different options available for connecting to your new database from .NET, and how to build a basic ASP.NET page that performs queries against the database.
Continue to Part 2 --> (http://www.15seconds.com/issue/050407.htm)