Linux下安装mysql 5.0.56

 
1. 下载并解包
将网络下载的mysql-5.0.56.tar.gz文件放在/usr/local/src目录并解包
# cd /usr/local/src
# tar xzvf mysql-5.0.56.tar.gz
# cd mysql-5.0.56
2. 编译安装
#./configure
--prefix=/usr/local/mysql
--localstatedir=/var/lib/mysql
--with-comment=Source
--with-server-suffix=-enterprise-gpl
--with-mysqld-user=mysql
--without-debug
--with-big-tables
--with-charset=utf8
--with-collation=utf8_general_ci
--with-extra-charsets=all
--with-pthread
--enable-static
--enable-thread-safe-client
--with-client-ldflags=-all-static
--with-mysqld-ldflags=-all-static
--enable-assembler
--without-innodb
--without-ndb-debug
--without-isam
--enable-local-infile
--with-readline
--with-raid
如果编译成功,你会看到:Thank you for choosing MySQL!

#make
在此过程中遇到"/usr/bin/ld: cannot find -lncurses"错误,安装libncurses5-dev包后再次编译正常。
#make install
安装完成
3. MYSQL配置
# groupadd mysql
# useradd -g mysql -s /bin/false -M mysql
# cd /usr/local/mysql
#bin/mysql_install_db --user=mysql
安装MYSQL系统表
Installing MySQL system tables...
OK
Filling help tables...
OK
......
设置目录文件权限
# chown -R root:mysql .
# chown -R mysql /var/lib/mysql
# chgrp -R mysql .
# cp share/mysql/my-medium.cnf /etc/my.cnf
# cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld
# chmod 755 /etc/rc.d/init.d/mysqld
加入自动启动服务队列
# chkconfig --add mysqld
配置库文件搜索路径
# echo "/usr/local/mysql/lib" >> /etc/ld.so.conf && ldconfig
开启或关闭mysqld服务
/etc/rc.d/init.d/ mysqld start/stop
service mysqld start/stop
修改root初始密码
bin/ mysqladmin -u root password "your password"
4. 安装完成
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值