Installing mySQL

Installing mySQL on Windows is a very simple task. All you need to do is to run the setup.exe program that comes with the Windows distribution. Once you have installed mySQL you will need to run the WinMySQLAdmin executable to set up the my.ini file.

To install mySQL on Linux, the easiest way is to use an RPM package. For the purpose of this book you will only need to use the server and client RPM packages. If you would like to install other packages you can download them at www.mysql.com.

To install the client and server as a standard install you should use the following line:

%> rpm -i MySQL-server-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm

Once the package is finished installing you should find a new directory under /var/lib/ called mysql. The mySQL install also adds the proper lines to the /etc/init.d/ file so the mySQL server will start on boot.

NOTE

If you are upgrading from a previous version of mySQL you will need to stop the current running service in order to install the new mySQL.

Once mySQL is installed you need to grant permission to a user and to tables. If you skip this step you will only be able to connect to your databases as root.You can add a user later but I recommend that you do this now. On Windows you need to type the following at the command prompt:

C:> cdmysqlscripts
C:> mysql_install_db
C:> cdmysqlin
C:> mysqld_safe --user=mysql &

Where --user=mysql you can put any user you want. For example, --user=mmodb would set up a user called mmodb.

If you are installing mySQL on a Linux machine you will need to type the following at a command prompt:

%> ./scripts/mysql_install_db
%> cd mysql_installation_directory
%> ./bin/mysqld_safe --user=mysql &

If you have problems creating your user and granting your user permissions to the database you should look at the documentation at www.mysql.com to see suggestions for troubleshooting.

Now go ahead and create the database that Kiddy Cartel will use to store its data. Go to a command prompt and navigate to the directory where you installed mySQL. Once you get in that directory, type the following:

./bin/mysqladmin create kiddycartel

This will create a new database called kiddycartel. Now you need to add a table to the database. To do that, first take a quick look at the T-SQL language.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset