构建MySQL服务器的安装步骤

配置Mysql:


1、安装 mysql 到指定目录再用源码包安装。

[root@localhost media]# tar -zxvf mysql-5.0.56.tar.gz -C /usr/src/

mysql-5.0.56/win/data/mysql/time_zone.frm

mysql-5.0.56/win/data/mysql/time_zone.MYI

mysql-5.0.56/win/data/mysql/time_zone.MYD

mysql-5.0.56/win/data/mysql/time_zone_transition.frm

mysql-5.0.56/win/data/mysql/time_zone_transition.MYI

mysql-5.0.56/win/data/mysql/time_zone_transition.MYD

mysql-5.0.56/win/data/mysql/time_zone_transition_type.frm

mysql-5.0.56/win/data/mysql/time_zone_transition_type.MYI

mysql-5.0.56/win/data/mysql/time_zone_transition_type.MYD

mysql-5.0.56/win/data/mysql/time_zone_leap_second.frm

mysql-5.0.56/win/data/mysql/time_zone_leap_second.MYI

mysql-5.0.56/win/data/mysql/time_zone_leap_second.MYD

mysql-5.0.56/win/data/mysql/proc.frm

mysql-5.0.56/win/data/mysql/proc.MYI

mysql-5.0.56/win/data/mysql/proc.MYD

mysql-5.0.56/win/data/mysql/procs_priv.frm

mysql-5.0.56/win/data/mysql/procs_priv.MYI

mysql-5.0.56/win/data/mysql/procs_priv.MYD

mysql-5.0.56/win/data/test/

 


2、配置、编译、安装Mysql服务 (编译安装期间时间较长,耐心等待)

 


[root@localhost /]# cd /usr/src/mysql-5.0.56/

[root@localhost mysql-5.0.56]# ./configure --prefix=/usr/local/mysql && make && make install

 


make[4]: Nothing to be done for `install-data-am'.

make[4]: Leaving directory `/usr/src/mysql-5.0.56/server-tools/instance-manager'

make[3]: Leaving directory `/usr/src/mysql-5.0.56/server-tools/instance-manager'

make[3]: Entering directory `/usr/src/mysql-5.0.56/server-tools'

make[4]: Entering directory `/usr/src/mysql-5.0.56/server-tools'

make[4]: Nothing to be done for `install-exec-am'.

make[4]: Nothing to be done for `install-data-am'.

make[4]: Leaving directory `/usr/src/mysql-5.0.56/server-tools'

make[3]: Leaving directory `/usr/src/mysql-5.0.56/server-tools'

make[2]: Leaving directory `/usr/src/mysql-5.0.56/server-tools'

make[1]: Leaving directory `/usr/src/mysql-5.0.56'

编译成功

 


3、创建运行Mysql的系统用户和组

 


[root@localhost mysql-5.0.56]# useradd -M -s /sbin/nologin mysql

 


4、建立配置文件

 


[root@localhost mysql-5.0.56]# cp support-files/my-medium.cnf /etc/my.cnf

相关推荐