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




Recommended Book
Build Your Own Wi-Fi Network (Build Your Own...(McGraw))
By
McGraw-Hill/OsborneMedia
Price: $0.32

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
$ Check REAL-TIME pricing for Linksys WRT54GS Wireless Router $
eBay: $43.10 TigerDirect.com: $59.99
TECHONWEB: $56.41 P.C. Richard & Son: $49.99
CompUSA.com: $59.99 Amazon: $73.99

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 Deals
    Linksys WRT300N Wireless Router


    CompUSA.com: $109.99 PCNation: $106.09
    TigerDirect.com: $109.99 Comparemaster: $89.00
    Amazon: $113.51 IT-DREAMZ.NET: $110.87
    Linksys WRT350N Wireless Router


    PCNation: $166.81 Dell: $179.99
    TigerDirect.com: $169.99 CompUSA.com: $169.99
    Super Warehouse: $167.99 B&H Photo-Video: $119.95
    Linksys WRT54GS Wireless Router


    TigerDirect.com: $59.99 eBay: $43.10
    P.C. Richard & Son: $49.99 TECHONWEB: $56.41
    PC Connection: $64.95 Server Supply.com Inc: $79.00
    D-link Xtreme N™ DIR-655 Wireless Router


    TigerDirect.com: $99.99 CompUSA.com: $99.99
    Beach Camera.com: $99.00 BuyDig.com: $92.00
    SafeMart: $438.19 Dell Small Business: $336.99
    Linksys WRT54GL Wireless Router


    eBay: $57.99 Dell: $69.99
    TECHONWEB: $63.71 CompUSA.com: $69.99
    Amazon: $57.99 PC Connection: $69.95

    RSSLatest News
    Titan Launches Cooler for Intel Core i7 CPUs
    November 20, 2008 - 4:47 PM PST
    Thermaltake Launches Fanless 330 VGA Cooler
    November 19, 2008 - 6:17 PM PST
    Mushkin Launches Triple-Channel DDR3 kits for Core i7 Processors
    November 18, 2008 - 6:43 PM PST
    Manufacturers Launch Intel X58 Motherboards
    November 18, 2008 - 6:11 PM PST
    Intel Launches Core i7 Processors
    November 18, 2008 - 6:02 PM PST
    Scythe Kama Panel 3.5” Multifunctional Panel
    November 17, 2008 - 6:50 PM PST
    AMD Launches 45-nm Opteron Processors
    November 14, 2008 - 4:34 PM PST
    Noctua Presents Cooler for Intel Core i7 CPUs
    November 12, 2008 - 11:37 AM PST
    Thermalright Launches Ultra-120 eXtreme Cooler
    November 11, 2008 - 4:04 AM PST
    PowerColor Launches Water-Cooling Ready Radeon HD 4870
    November 10, 2008 - 4:22 PM PST
    .:: More News ::.

    RSSLatest Content
    Seventeam ST-550P-AG Power Supply Review
    Logitech QuickCam Pro 9000 Review
    GeForce GTX 260 with 216 cores Video Card Review
    Laptop Design: What are some ways that form can enhance function?
    Panasonic Link-to-Cell Phone System Review
    Topower TOP-1100P10 Power Supply Review
    Gigabyte MA78GM-S2H Motherboard
    OCZ Neural Impulse Actuator Review
    OCZ EliteXStream 1000 W Power Supply Review
    Everything You Need to Know About Megapixels
    Battery Life: How Long Does a Battery Need to Last?
    Corsair HX1000W Power Supply Review
    AMD ATI Chips Comparison Table
    What is the ideal size for a notebook?
    ASUS P6T Deluxe OC Palm Edition Motherboard

    Our Most Popular Articles
    Maximum CPU Temperature
    822,358 views
    nVidia Chips Comparison Table
    512,445 views
    AMD ATI Chips Comparison Table
    451,286 views
    How to Find Out Your Motherboard Manufacturer and Model
    432,901 views
    ATI Radeon X1300 Pro Review
    428,901 views
    ATI Radeon X1600 XT Review
    422,428 views
    Connecting Two PCs Using a USB-USB Cable
    384,198 views
    How To Correctly Apply Thermal Grease
    368,661 views
    Sempron vs. Athlon XP
    289,590 views
    Sempron 3400+ Review
    281,975 views

    Latest Threads in Our Forums
    Seventeam ST-550P-AG Power Supply Review
    by Olle P
    Thermaltake Launches Fanless 330 VGA Cooler
    by Olle P
    Best thermal paste on the market?
    by zargon48
    Thnx for help w/new buid!!
    by zargon48
    How to Manually Clean Your VCR Heads
    by Gabriel Torres
    Titan Launches Cooler for Intel Core i7 CPUs
    by Hardware Secrets Team
    Computer to Sony Bravia 23 in (1920 x 1080)
    by Wromx
    Logitech QuickCam Pro 9000 Review
    by Hardware Secrets Team
    Motherboard Repairing
    by joseph
    GeForce GTX 260 with 216 cores Video Card Review
    by Hardware Secrets Team
    .:: Visit Our Forums ::.

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