linux版本:Red Hat Enterprise Linux Server release 5.6 (Tikanga)
Kernel \r on an \m
mysql版本:mysql-5.0.41
一、释放源码包文件
#tar zxvf mysql-5.0.41.tar.gz -C /usr/local/src
#cd /usr/local/src/mysql-5.0.41
二、编译前的配置
#./configure --prefix=/usr/local/mysql
注意:这一步之前要确认系统内是否有安装ncurses-devel包,否则在./configure时会出现如下错误信息
checking for tgetent in -lncurses... no
checking for tgetent in -lcurses... no
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for termcap functions library... configure: error: No curses/termcap library found
解决办法:安装ncurses-devel包
#rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm (光盘或网上下载此包)
三、编译服务器程序
#make
四、安装已编译完成的程序
#make install
五、建立mysql用户和组
#groupadd -g 200 mysql
#useradd -u 200 -g mysql mysql
六、进入mysql服务器程序目录,复制mysql的配置文件my.cnf到“/etc“目录中
#cd /usr/local/mysql
#cp share/mysql/my-medium.cnf /etc/my.cnf
七、以mysql用户初始化mysql服务器中的数据库
#bin/mysql_install_db --user=mysql
八、设置服务器安装目录以及数据库所在目录的属主和属组
#chown -R root .
#chown -R mysql var
#chgrp -R mysql .
以上配置均在/usr/loca/mysql中进行
九、以系统用户mysql使用mysqld_safe命令启动MYSQL服务器运行
#/usr/local/mysql/bin/mysqld_safe --user=mysql &
十、为mysql数据库中的root用户设置密码(默认情况下root为空密码)
#/usr/local/mysql/bin/mysqladmin -u root password '123456'
十一、登录mysql服务器的交互界面
#/usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 50
Server version: 5.5.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
在使用root账户登录mysql操作环境后会出现“mysql>"提示符,在该状态下可输入命令对mysql数据库进行操作
十二、使用netstat命令查看服务相对应端口监听情况
#netstat -tuln | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
至此基本安装与配置全部结束!
阅读(672) | 评论(0) | 转发(0) |