Tìm kiếm với Google


Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Thursday, February 28, 2008

Install Upgrade MySQL 5 on Redhat Enterprise version 4 (RHEL4)



Upgrade MySQL 4.1 to 5.0 on RHEL4:
With Debian(Ubuntu) install and upgrade are very easy but on Fedora or Redhat it very difficult.
On Redhat Enterprise 4.0 before upgrade MySQl 4.1 to MySQL 5.0 you must uninstall MySql 4.1 first.
You can follow these command :

#rpm -e mysql-devel-4.1.7-4.RHEL4.1.i386
#rpm -e mysql-server-4.1.7-4.RHEL4.1.i386
#rpm -e mysql-4.1.7-4.RHEL4.1

After you removed old MySQL 4.1 you need download these packages:
MySQL-shared-compat-5.0.51a-0.rhel4.i386.rpm,MySQL-devel-community-5.0.51a-0.rhel4.i386.rpm,MySQL-server-community-5.0.51a-0.rhel4.i386.rpm ,MySQL-client-community-5.0.51a-0.rhel4.i386.rpm
It can be download on website mysql:
http://dev.mysql.com/downloads/mysql/5.0.html#
when downloaded you enter these command:

#rpm -ivh MySQL-shared-compat-5.0.51a-0.rhel4.i386.rpm
#rpm -ivh MySQL-devel-community-5.0.51a-0.rhel4.i386.rpm
#rpm -ivh MySQL-server-community-5.0.51a-0.rhel4.i386.rpm
#rpm -ivh MySQL-client-community-5.0.51a-0.rhel4.i386.rpm

At the Terminal :when you entered command mysql
it can be show this:


Your MySQL connection id is 13
Server version: 5.0.51a-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

Congratulations,You have Mysql 5.0 Installed
(I'm so sorry if I make mistake in English Grammar)

Friday, February 22, 2008

Connect PHP and MySQL

Create file db_connect.php
db_connect.php content:
$host=localhost ;Mysql -server hostname
$user=root;// user privileges for mysql
$pass=password ;// User password
$port=3306;// Mysql port,common is 3306
mysql_connect($host,$user,$pass) or die ("could not connect to databases");
?>
And then,in other PHP file just add line
include("db_connect.php");

Thursday, February 21, 2008

Installling Apache PHP MySQL on Ubuntu

Install Apache and PHP 5

Apache HTTP Server

from terminal type:
sudo apt-get install apache2
start Apache server:
sudo /etc/init.d/apache2 start
from web browser type into adress bar: localhost


How to install PHP 5

sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart

To test if PHP 5 installed correctly
sudo gedit /var/www/testphp.php
insert following line :

save and exit.
from web browser type to adress bar: localhost/testphp.php
If that didn't work, try these commands:
sudo a2enmod php5
sudo /etc/init.d/apache2 force-reload
(Optional) Install recommended PHP5 modules:
sudo apt-get install php5-xsl php5-gd php-pear
Restart Apache
sudo /etc/init.d/apache2 restart

The root directory of your web server is /var/www/ so you must
place your projects in this folder.


How to install MYSQL for Apache HTTP Server

sudo apt-get install mysql-server
gksudo gedit /etc/mysql/my.cnf
Find the line bind-address = 127.0.0.1 and comment it out
...
#bind-address = 127.0.0.1
...
sudo /etc/init.d/mysql restart

sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo aptitude install phpmyadmin
gksudo gedit /etc/php/apache2/php.ini
You'll need to uncomment the ";extension=mysql.so" line so that
it looks like this
...
extension=mysql.so
...
from web browser type: http://localhost/phpmyadmin
sources from http://ubuntuguide.org/wiki/Ubuntu