lamp之源码包安装mysql

http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-6.0/mysql-6.0.11-alpha.tar.gz
tar -xzvf mysql-6.0.11-alpha.tar.gz
mv mysql-6.0.11-alpha  mysql


======================mysql======================
1.创建mysql所需的目录
mkdir -p mysql/{etc,database}
2.创建mysql用户组
useradd mysql
3.检查编译环境 echo $? 当为0的时候表示没有错误
./configure \
--prefix=/data1/services/mysql \
--sysconfdir=/data1/services/mysql/etc \
--localstatedir=/data1/services/mysql/database \
--with-charset=utf8


http://blog.sina.com.cn/s/blog_476c7f7201017pw1.html


configure: error: no acceptable C compiler found in $PATH
details.你的机器里没有安装任何C语言编译器,可以安装gcc。 可以在安装盘里找到gcc相关的包进行安装,不过会比较繁琐,因为关联的包会比较多。 如果可以上网,使用yum安装是比较好的选择: yum install gcc
yum -y install wget gcc gcc-c++ ncurses-devel cmake make perl


4.编译安装mysql
make && make install


make: *** No targets specified and no makefile found.  Stop.
http://blog.sina.com.cn/u/2439416855
http://blog.sina.com.cn/s/blog_91668c17010141vl.html
仔细查看 ./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(重点错误)
看错误提示 可知是找不到curses,,  所以是缺少ncurses安装包  造成的
解决方法如下:
 
我的系统是RedHat5系列:
yum list|grep ncurses
yum -y install ncurses-devel
完成后,重新 ./configure --prefix=/data1/services/mysql --with-charset=gbk,make && make install


5.安装mysql test information_schema数据库
cd /data1/services/mysql
bin/mysql_install_db --user=mysql


6.建立mysql配置文件
cd mysql目录
cp share/mysql/my-huge.cnf /etc/my.cnf
cp share/mysql/mysql.server /etc/rc.d/init.d/mysqld


chown -R mysql:mysql database
chown -R mysql:mysql lib


./bin/mysqld_safe & --user=mysql
cd /data1/services/mysql ; /data1/services/mysql/bin/mysqld_safe &


7.增加mysql服务
chkconfig --add mysqld
service mysqld restart
[root@localhost mysql]# service mysqld restart
Shutting down MySQL.161009 11:30:18 mysqld_safe mysqld from pid file /data1/services/mysql/database/localhost.localdomain.pid ended
 SUCCESS! 
Starting MySQL. SUCCESS! 
[1]+  Done                    bin/mysqld_safe


chkconfig mysqld on
8.将mysql相关命令复制到/sbin目录
cp bin/* /sbin
9.使用mysqladmin创建mysql管理员及密码
mysqladmin -u root password 123456
/data1/services/mysql/bin/mysqladmin -u root password 'new-password'
/data1/services/mysql/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'


http://blog.csdn.net/ixidof/article/details/5958904/
error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'


ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock


rm -rf /var/lock/subsys/mysql
http://zhangge.net/4225.html
[root@localhost ~]# service mysqld start
Starting MySQL. ERROR! Manager of pid-file quit without updating file.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值