|
การติดตั้ง MySQL และ PostgreSQL
MySQL
ให้ใส่ CD แผ่นที่ 1 ใน เครื่อง Server และที่เครื่องลูกที่เราทำงาน ไปที่หน้าต่างของโปรแกรม putty
[root@one root]# mount /mnt/cdrom [root@one root]# cd /var/tmp/ [root@one tmp]# rm -rf * [root@one tmp]# [root@one tmp]# cp /mnt/cdrom/RedHat/RPMS/perl-5.6.1-34.99.6.i386.rpm . [root@one tmp]# eject
ให้ใส่ CD แผ่นที่ 3 ใน เครื่อง Server และที่เครื่องลูกที่เราทำงาน ไปที่หน้าต่างของโปรแกรม putty
[root@one root]# mount /mnt/cdrom [root@one root]# cd /var/tmp/ [root@one tmp]# cp /mnt/cdrom/RedHat/RPMS/mysql-3.23.49-3.i386.rpm . [root@one tmp]# eject
ลอง ls ดูว่ามาครบทั้ง 2 files หรือไม่
[root@one tmp]# ls mysql-3.23.49-3.i386.rpm perl-5.6.1-34.99.6.i386.rpm
ทำการติดตั้งแฟ้มทั้งหมด
[root@one tmp]# rpm -Uvh *.rpm Preparing... ########################################### [100%] 1:perl ########################################### [ 50%] 2:mysql ########################################### [100%] [root@one tmp]#
ในการ Config เราจะเริ่มด้วยการ ใส่ password สำหรับ user root ดังนี้นะครับ
[root@one tmp]# cd /var/lib/mysql [root@one mysql]# mysql -u root mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 to server version: 3.23.49
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SET PASSWORD FOR root=PASSWORD('mysqlrootpassword'); Query OK, 0 rows affected (0.01 sec)
mysql> \q Bye [root@one mysql]#
จากนั้นเราจะลองสร้าง database ซักตัว ในที่นี้ผู้เขียนจะสร้าง database ชื่อ phorum เพื่อใช้ในการทำกระดานข่าวโดย
[root@one root]# cd /var/lib/mysql [root@one mysql]# ls mysql mysql.sock test [root@one mysql]# mysql -u root mysql -p Enter password: Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 17 to server version: 3.23.49
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> CREATE DATABASE phorum; Query OK, 1 row affected (0.00 sec)
mysql> \q Bye [root@one mysql]# ls mysql mysql.sock phorum test [root@one mysql]#
จะเห็นว่าเราได้ database เพิ่มขึ้นมาอีกตัว คือ phorum
PostgreSQL
ให้ใส่ CD แผ่นที่ 2 ใน เครื่อง Server และที่เครื่องลูกที่เราทำงาน ไปที่หน้าต่างของโปรแกรม putty
[root@one tmp]# mount /mnt/cdrom [root@one root]# rm -rf * [root@one tmp]# cp /mnt/cdrom/RedHat/RPMS/postgresql-libs-7.2.1-5.i386.rpm . [root@one tmp]# cp /mnt/cdrom/RedHat/RPMS/postgresql-7.2.1-5.i386.rpm .
ลอง ls ดูว่ามาครบทั้ง 2 files หรือไม่
[root@one tmp]# ls postgresql-7.2.1-5.i386.rpm postgresql-libs-7.2.1-5.i386.rpm
ทำการติดตั้งแฟ้มทั้งหมด
[root@one tmp]# rpm -Uvh *.rpm Preparing... ########################################### [100%] 1:postgresql-libs ########################################### [ 50%] 2:postgresql ########################################### [100%] [root@one tmp]#
เราก็จะได้ MySQL และ PostgreSQL มาใช้งาน ส่วนจะเลือกเอาอันไหน ขึ้นอยู่กับผู้ใช้นะครับ แต่ผู้เขียนใช้แต่ MySQL อย่างเดียว
|