India seo web development website designer freelance Creating the MySQL database

The sample files for  MX 2004 include a SQL script capable of creating and populating a sample MySQL database.

Before starting, make sure MySQL is installed and configured on your local or remote computer.

To create the sample MySQL database:

  1. Copy the SQL script file, insert.sql, to an appropriate folder on the computer that has MySQL installed.

    If you installed to its default location, the path to the script file is as follows:

    If the computer running MySQL is a Windows computer, copy the insert.sql script to MySql\Bin. If the computer running MySQL is a Macintosh, copy the insert.sql script to your Documents folder in your home folder.

  2. On the computer that has MySQL installed, open a command prompt window (Windows) or a Terminal window (Macintosh).
  3. (Windows only) Change to the mysql\bin directory by entering the following commands at the command prompt: cd \ cd mysql\bin

    Note: On the Macintosh, you should be able to run mysql from any directory; it should have been added to your path during installation of MySQL. If the following step doesn't work on the Macintosh, though, try typing /usr/local/bin/mysql instead of mysql .

  4. Start the MySQL client by entering the following command: mysql -u User -p Password

    For example, if your MySQL user name (also known as an account name) and password are Tara and Telly3, then enter the following command:

    mysql -uTara -pTelly3

    If you don't have a password, omit the -p argument as follows:

    mysql -uTara

    If you didn't define a user name while configuring your MySQL installation, enter root as the user name, as follows:

    mysql -uroot

    The MySQL client's command prompt appears, as follows:

    mysql>
  5. Create a new database by entering the following command at the MySQL prompt: mysql>CREATE DATABASE TrioMotors;

    MySQL creates a new database, but it doesn't contain any tables or records yet.

  6. Log out of the MySQL client by entering the following command at the prompt: mysql>quit;
  7. At the system command prompt, populate the new TrioMotors database in MySQL.

    In Windows, use the following command:

    mysql -u User -p Password TrioMotors < insert.sql

    On the Macintosh, use the following command:

    mysql -u User -p Password TrioMotors < ~/Documents/insert.sql

    This command uses the insert.sql file to add tables and records to the TrioMotors database you created in step 5.

After creating the MySQL database, create a database connection to it in .

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

India web developer website development India