MySQL is a very fast, multi-threaded, multi-user SQL database server. It can utilize multiple CPUs, supports many column types and very large databases. MySQL does not currently support foreign keys and subselects though its blazing speed, flexibility, and price (free) make it very attractive.
No matter how easy to manage data in PHP, sooner or later you will need the power of a relational database server. SQL is a wonder language: simple yet extremely powerful. It enables queries written in plain English, and can handle very complex queries. MySQL is an ideal choice for a database server because of its powerful features and tight integration with PHP.
If you want to install MySQL under Windows, you can download the latest version directly from Wow Web Designs. If you are going to install it under anything other than Windows you can find several different versions for various platforms at http://www.mysql.com/Downloads/. You can download binaries (already compiled, executable versions) for faster installation. However I prefer to download source distributions and compile them on my own system for best performance and full control over the installation process. You also cannot always find the latest release in already compiled form for your system. Meanwhile, compiling may take a long time (up to a few hours) on slow systems. If you decide to compile MySQL, download the Tarball (mysql-3.23.xx.tar.gz) at the above location where xx is the latest release. I will explain the installation process step by step in the next section.
If you are using Windows NT or 2000, and installed MySQL in a folder other than
C:\MYSQL, you must create a file named C:\MY.CNF with the following
information in order to run it as a service:
[mysqld]
basedir= drive:/installation-path/
Run the Setup program, and install it to a folder of your choice such as C:\MySQL or C:\Program Files\MySQL. That's all. I will explain how to run and configure it in the following sections.
MySQL Components.
For Unix (including Linux)
Download MySQL in a directory of your choice, if you already didn't. The command bellow will download it for you where xx is the latest version. You can of course download it with your web browser too:
Assuming that the MySQL archive is in the current directory decompress it with
gunzip -c mysql-3.23.xx.tar.gz | tar -xvf -
This will create a directory named mysql-3.23.xx in the current directory. Change to it by typing
cd mysql-3.23.xx
Now create a group named mysql:
groupadd mysql
Create a user named mysql belonging to group mysql:
useradd -g mysql mysql
Run the configuration program with the most common options. This will configure MySQL for to be installed to the default location (/usr/local/mysql). Even if you have lots of memory, compiling may take forever (and I mean it) if you don't use the --with-low-memory option because a file called sql_yacc.cc in the source distribution needs huge amounts of memory to compile. So use that option, you won't lose anything.
Change to the folder you installed MySQL by using My Computer or Windows Explorer. Change to the bin folder. If you are using Windows 9x, run either mysqld.exe or mysqld-opt.exe (the latter is optimized for Pentium processors).
If you are using Windows NT or 2000 open the DOS prompt; change to the MySQL bin folder, and type
mysqld-nt --install
NET START mysql
For Unix (including Linux)
To start MySQL type the following (assuming that you installed it in /usr/local/mysql), and don't forget the ampersand (&).
Fantastic site - just what I need to get PHP-Apache-Linux-mySQL up and running. I am an amateur programmer from India, and I have developed both internet and intranet sites on the Windows platform. Now, out of curiosity and necessity, I am changing to Linux. Here's wishing myself all the best and hey, you too. Keep up the good work !!!!
I've searched TONS of web pages over the past 4 days looking for information on how to set up my server after messing it up. The information contained in this article helped me get my web pages back online.
The only thing I wish it did more of was went into greater detail on the httpd.conf file settings such as creating additional virtual hosts.
good article. But is it true that it is only possible to run on apache and maybe not personal web server? If it is possible, I hope you can give me the correct way to do it.
Great!!! thank u very much, i spent more than one day looking for a tutorial like this one, nothing was working! finally i got it!!!, im going to add a link to u on my website thanx again! from Tepatitlan Jalisco Mexico, your friend Gera!
Wow. What a great article. Previously I was running VMWare on top of Win2k so I can run apache+php+mysql. That was a pain in the ass and vmware decided to fail me this morning. I just couldn't get it running again. I much prefer running everything natively like this.
This article made all the configuring a breeze, not to mention the binaries you guys made available for us.