Hardware Secrets
Home | Camera | Case | CE | Cooling | CPU | Input | Memory | Mobile | Motherboard | Networking | Power | Storage | Video | Other
Content
Articles
First Look
Gabriel's Blog
News
Reviews
Tutorials
Main Menu
About Us
Awarded Products
Compare Prices
Datasheets
Dictionary
Download
Drivers
Forums
Links
Manufacturer Finder
Newsletter
On The Web
RSS Feed
Test Your Skills
Twitter
Newsletter
Subscribe today!
Search




Recommended
Wireless Home Networking For Dummies
Wireless Home Networking For Dummies, by Edward Ferris (For Dummies), starting at $12.12
Home » Networking
How to Build a Web Server with PHP 5 and MySQL 5 Support
Author: Gabriel Torres
Type: Tutorials Last Updated: April 19, 2007
Page: 3 of 5
Real-time pricing for Sony SNC-RZ25N.
Sony 340 Indoor Exwave IP Network Camera SNCRZ25N P/T/Z
TigerDirect: $779.99 Newegg: $749.99
CompUSA: $779.99 Buy.com: $749.15

Configuring and Installing MySQL 5

This step is required because PHP 5 does not bring embedded MySQL support anymore. Even if you are not installing a MySQL 5 server on the same server as your web server, this step is required in order to install MySQL 5 client, in order to allow PHP 5 to connect to MySQL 5 servers.

The first thing you need to know is that MySQL 5 does not bring separated packages for client and server configurations, like MySQL 4 – everything is inside the same package. Also, the procedure for installing a MySQL client is different from installing a MySQL server.

If you don’t want a MySQL 5 server running on the same server as your web server – which is desirable for large websites, i.e. you will have one web server running Apache + PHP and another server running exclusively MySQL – you will need to install only a “client” version of MySQL 5.

If you want a MySQL 5 server running on the same server as your web server, then you will need to install the whole MySQL 5 server.

The procedure for these two scenarios is quite different, so you need to know which path to take.

Anyway, for both scenarios the first thing you need to do is to uninstall any MySQL version you may already have installed on your server.

On Debian you can do this by running (assuming that the old version was 4.1, of course):

apt-get remove mysql-server-4.1
apt-get remove mysql-client-4.1

On Fedora you can do this by running:

rpm -e <module_name>

With rpm -qa | grep MySQL you can find out the MySQL modules you have installed and that you will need to remove.

You can also, just in case, move the old MySQL libraries that may be left in the system to a backup location, with:

mv /usr/lib/libmysql* /root

So if anything goes wrong you still have these files.

Here comes the tricky part. If you want to install just MySQL 5 client, you will need to download the source code. The problem is that the source code is the last thing on MySQL  downloads page, and a lot of people download the binaries instead, which contains MySQL server, not the client.

If you want to install MySQL 5 server on the same server as your web server, you will need to download both the source code and the binaries. Of course you can compile the source code to get the binaries done, however here is a important trick: according to MySQL website, if your server is based on an Intel CPU, the binaries compiled with Intel compiler will make your MySQL 5 server to run 20% faster than installing the standard binaries compiled with gcc. Since our server was a dual-Xeon, we preferred to download the Intel-compiled version rather than compiling MySQL 5 by ourselves.

So, for both scenarios you will need to create MySQL 5 client. As we mentioned, this is done by downloading the MySQL 5 source code at http://dev.mysql.com/downloads/mysql/5.0.html – it is the very bottom of this page. Download the “Compressed GNU TAR archive (tar.gz)” version.

The downloading, configuration and installation sequence would be the following:

cd /root
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.37.tar.gz/from/http://mysql.orst.edu/
tar -xvzf mysql-5.0.37.tar.gz
cd mysql-5.0.37
./configure --without-server
make
make install

You can check if your installation was successfully done by checking if the new mysql libraries were installed at /usr/lib:

ls /usr/lib/libmysql*

The output should be something like this:

/usr/lib/libmysqlclient_r.so.15      /usr/lib/libmysqlclient.so.15
/usr/lib/libmysqlclient_r.so.15.0.0  /usr/lib/libmysqlclient.so.15.0.0

If you can’t find these files or if they are using a version lower than 15, you must redo the above procedures, making sure to run make clean before starting over.

Now your MySQL 5 client is installed. The next step is installing MySQL 5 server, if you want to have a MySQL 5 server on the same server as your web server. MySQL 5 server installation is quite easy.

Download the compiled binaries from http://dev.mysql.com/downloads/mysql/5.0.html and install them. As we said before, if your server is based on an Intel CPU, you should download the “Linux (non RPM, Intel C/C++ compiled, glibc-2.3) downloads” version. That is the version we downloaded, so the step-by-step of installing this package would be the following:

cd /root
wget http://dev.mysql.com/get/Downloads/MySQL-5.0/mysql-5.0.37-linux-i686-icc-glibc23.tar.gz/from/http://mysql.orst.edu/
tar -xvzf mysql-5.0.37-linux-i686-icc-glibc23.tar.gz
mv mysql-5.0.37-linux-i686-icc-glibc23 mysql
groupadd mysql
useradd -g mysql mysql
mv mysql /usr/local
cd /usr/local/mysql
scripts/mysql_install_db --user=mysql
chown -R root  .
chown -R mysql data
chgrp -R mysql .
bin/mysqld_safe --user=mysql &

Note the path where MySQL will be installed: /usr/local/mysql.

Edit /etc/profile and add :/usr/local/mysql/bin at the end of the PATH statement.

Pages (5): « 1 2 [3] 4 5 »
Print Version | Send to Friend | | Bookmark Article | Comments (7)

Related Content
  • All Opteron Models
  • All Xeon Models

  • Recommended Deal.
    DLink DIR-655DLink DIR-655

    D-Link DIR-655 Extreme N Wireless Router Electronics D Link D-Link Extreme N Wireless Router DIR-655

    Amazon: $91.54 Wal-Mart: $91.54
    TigerDirect: $94.99 Newegg: $94.99

    RSSLatest News
    Sparkle Announces 2 GB GeForce GT 220 Video Card
    March 19, 2010 - 10:17 AM PST
    PowerColor Launches HD 5770 Eyefinity 5 Video Card
    March 19, 2010 - 9:59 AM PST
    In Win Intros IRONCLAD Mid-Tower Case
    March 19, 2010 - 9:39 AM PST
    A-Data Intros 8 GB DDR3 Memory Kit
    March 17, 2010 - 3:40 PM PST
    Intel Launches Xeon 5600 Series and Core i7-980X Processor
    March 16, 2010 - 3:46 PM PST
    Intel Launches 40 GB X25-V SSD Drive
    March 15, 2010 - 1:43 PM PST
    Arctic Cooling Intros Cooler for Radeon HD 5970 and HD 5870
    March 12, 2010 - 12:19 PM PST
    OCZ Announces 32 GB Onyx SSD Unit
    March 10, 2010 - 4:08 PM PST
    MSI Launches X-Slim X360 Laptop
    March 9, 2010 - 4:15 PM PST
    Spire Launches TherMax Eclipse II CPU Cooler
    March 8, 2010 - 2:59 PM PST
    .:: More News ::.

    RSSLatest Content
    All Mobile Celeron Models
    Epson WorkForce 610 All-in-One Printer Review
    All Core i5 Models
    Mionix Naos 5000 Mouse Review
    Arctic Cooling E361-WM Earphones Review
    Don’t Let Your IT Projects Become Vaporware
    OCZ Z Series 850 W Power Supply Review
    HIS Radeon HD 5570 Fan Video Card Review
    Core i7-980X CPU Review
    Gelid Tranquillo CPU Cooler Review
    How to Discover Your Power Supply Real Manufacturer
    OCZ Z Series 1000 W Power Supply Review
    Amacrox Free Earth 85PLUS 650 W Power Supply Review
    ECS A890GXM-A Motherboard
    ASUS M4A89GTD PRO/USB3 Motherboard Review

    Our Most Popular Articles
    Maximum CPU Temperature
    1,154,183 views
    How to Find Out Your Motherboard Manufacturer and Model
    816,875 views
    nVidia Chips Comparison Table
    742,761 views
    Connecting Two PCs Using a USB-USB Cable
    671,869 views
    How To Correctly Apply Thermal Grease
    624,790 views
    AMD ATI Chips Comparison Table
    609,583 views
    ATI Radeon X1300 Pro Review
    506,593 views
    ATI Radeon X1600 XT Review
    494,247 views
    How To Perform a BIOS Upgrade
    443,102 views
    Understanding RAM Timings
    381,176 views

    Latest Threads in Our Forums
    Custom PC Help
    by thebigman101
    All Mobile Celeron Models
    by Hardware Secrets Team
    Sparkle Announces 2 GB GeForce GT 220 Video Card
    by Hardware Secrets Team
    PowerColor Launches HD 5770 Eyefinity 5 Video Card
    by Hardware Secrets Team
    In Win Intros IRONCLAD Mid-Tower Case
    by Hardware Secrets Team
    Corsair CX400W Power Supply Review
    by Olle P
    Epson WorkForce 610 All-in-One Printer Review
    by Hardware Secrets Team
    A-Data Intros 8 GB DDR3 Memory Kit
    by Hardware Secrets Team
    Epson WorkForce 610 All-in-One Printer
    by Hardware Secrets Team
    Mionix Naos 5000 Mouse Review
    by Mescalamba
    .:: Visit Our Forums ::.


    © 2004-10, Hardware Secrets, LLC. All rights reserved.
    Advertising | Legal Information | Privacy Policy
    All times are Pacific Standard Time (PST, GMT -08:00)