how to install apache, PHP and MySQL on Linux
how to install apache, PHP and MySQL on Linux
This tutorial explains the installation of Apache web server, bundled with PHP and MySQL server on a Linux machine. The tutorial is primarily for SuSE 9.2, 9.3, 10.0 & 10.1 operating systems, but most of the steps ought to be valid for all Linux-like operating systems.
Contents:
MySQL 5 Installation
Prerequisites
Download the Source
Unpack, Copy, Configure
Create my.cnf File
Additional Settings
Start Server, Check It, Connect
Set the Root Password
Restart MySQL Server
Automatic Startup
Apache 2 Installation
PHP 5 Installation
MySQL 5.0 installation
Since Apache and MySQL servers must be installed prior to the PHP installation, I recommend installing the triad in this order: MySQL, Apache, PHP. You may well have some MySQL server already installed – in that case you can skip directly to the Apache 2 installation. However, it's a good idea to reinstall everything, in order to have the most recent versions of the software.
There are several options for how to install MySQL:
using YaST – the easiest and fastest way. However, the version of MySQL bundled with SuSE installation is usually NOT the best (i.e. the most recent) available,
RPM installation – supposedly also fast and simple, I've never tried though. The only drawback here is that MySQL is not installed into a single destination – it's scattered across several directories. I like to keep things tidy, so I skipped this option,
installing binaries – downloading precompiled files from the mysql.com website, copying them into a directory of your choice, and doing some simple configuration. I tried this, but it didn't work for me – for some reason the MySQL server wouldn't start,
installing from source – I would recommend this. Yes, it takes some time and effort, but you will get the most recent MySQL installed in a single location on your system, and everything will be configured accord
Ïà¹ØÎĵµ£º
ÒýÓà ҹÂä¹ÅÁú µÄ MySql Administrator µÄ¼òµ¥Ê¹Óã¨Í¼£©
MySQL AdministratorÌṩͼÐνçÃæÒÔ°ïÖúÄã¹ÜÀíMySQLÊý¾Ý¿â£¬WindowsÓû§¿ÉÒÔͨ¹ýÃüÁîÌáʾÐÐÔËÐÐMySQL
Administrator£¬ÔÚÓàÏÂʱ¼äÀïÎÒ¼Ù¶¨ÄãÒѾ°²×°ÁËMySQL Administrator£¬²¢ÇÒ½«Ê¹ÓÃÏà¹ØͼÀý¡£
MySQL
AdministratorÖ÷½çÃæ
¡¡¡¡´´½¨Êý¾Ý¿â
......
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµÄuser±í£¬²»¹ý±ðÍüÁËʹÓÃPASSWORDº¯Êý¡£
·½·¨¶þ
ʹÓÃmysqladmin£¬ÕâÊÇÇ°ÃæÉùÃ÷µÄÒ»¸öÌØÀý¡£
mysqladmin -u root -p password mypasswd
ÊäÈëÕâ¸öÃüÁîºó£¬ÐèÒªÊäÈërootµÄÔÃÜÂ룬ȻºórootµÄÃÜÂ뽫¸ÄΪmypasswd¡£
°ÑÃüÁîÀïµÄroot¸ÄΪÄãµÄÓû§Ãû£¬Äã¾Í¿ÉÒ ......
Ò»¡¢ÎÊÌâµÄÌá³ö
¡¡¡¡ÔÚÓ¦ÓÃϵͳ¿ª·¢³õÆÚ£¬ÓÉÓÚ¿ª·¢Êý¾Ý¿âÊý¾Ý±È½ÏÉÙ£¬¶ÔÓÚ²éѯSQLÓï¾ä£¬¸´ÔÓÊÓͼµÄµÄ±àдµÈÌå»á²»³öSQLÓï¾ä¸÷ÖÖд·¨µÄÐÔÄÜÓÅÁÓ£¬µ«ÊÇÈç¹û½«Ó¦ÓÃϵͳ
Ìύʵ¼ÊÓ¦Óúó£¬Ëæ×ÅÊý¾Ý¿âÖÐÊý¾ÝµÄÔö¼Ó£¬ÏµÍ³µÄÏìÓ¦ËٶȾͳÉΪĿǰϵͳÐèÒª½â¾öµÄ×îÖ÷ÒªµÄÎÊÌâÖ®Ò»¡£ÏµÍ³ÓÅ»¯ÖÐÒ»¸öºÜÖØÒªµÄ·½Ãæ¾ÍÊÇSQLÓï¾äµÄÓÅ»¯¡£ ......
mysql 4.1µÄ¸Ä±äÔì³ÉµÄÂÒÂë½â¾ö·½·¨
µÚÒ»¸ö·½·¨£º
MySQL 4.1 ÖÐÎÄÂÒÂëµÄÎÊÌâ
×î½üÒª½« MySQL 4.0 Éý¼¶µ½ MySQL 4.1 £¬·¢ÏÖÁËÖÐÎÄÂÒÂëµÄÎÊÌ⣬ϣÍûÒÔϼû½â¶Ô´ó¼ÒÓÐÓá£
1. MySQL 4.1 ÔÚÎÄ×ÖÉÏÓкܴó¸Ä½ø£¬ËüÓÐÁË Character Set Óë Collation µÄ¿®Äî¡£
2. ÔÚ MySQL 4.0 £¬Ò»°ãµÄ³Ìʽ¶¼»á½«ÎÄ×ÖÒÔÀ¶¡ÎÄ ( latin) ......
1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖظ´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âÇ°£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°È ......