./configure --prefix=/usr/local/mysql --with-extra-charsets=all  --with-innodb --with-plugins=partition

然后进行make 

报如下错误

../depcomp: line 571: exec: g++: not found

make[1]: *** [my_new.o] Error 127

make[1]: Leaving directory `/usr/local/src/mysql-5.1.34/mysys'

make: *** [all-recursive] Error 1


网上回答是

yum install -y gcc-c++

好吧,安装了这个,这个错是没有报,再执行make

./include/my_global.h:1110: error: redeclaration of C++ built-in type ‘bool’

查询了一下,网友说是没有安装c++,但是我查询了一下,有啊

[root@localhost Packages]# rpm -qa | grep gcc-c++

gcc-c++-4.4.7-11.el6.i686

再看看别的文章,说可以重新./configure试试,好吧,重来吧

[root@localhost Packages]# !145 回车走你

我是虚拟机安装的centos,分配了730M内存,make一下怎么这么久啊,艹留都逛了一圈了,还没完事……

make竟然没有报错,赶紧make install

竟然没有再报错

下一步我们就来进行初始化一下

[root@localhost bin]# ./mysql_install_db 

看看/usr/local/mysql生成var这个文件夹,如果有,则说明生成成功

[root@localhost var]# ls

localhost.localdomain.err  mysql  test

[root@localhost var]# pwd

/usr/local/mysql/var

然后再把这个MySQL服务起来一下

我竟然执行了servie mysqld restart ,结果可想而知……

[root@localhost bin]#  ./mysqld_safe --user=mysql &

然后可以验证下有没有跑起来

[root@localhost Packages]# ps -aux | grep 'mysql'

Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

root     31177  0.0  0.1   4356   744 pts/1    S+   00:42   0:00 grep mysql

好,起来了,人品不错嘛,该设置一个密码了

[root@localhost bin]# /usr/local/mysql/bin/mysqladmin password 123456

/usr/local/mysql/bin/mysqladmin: connect to server at 'localhost' failed

error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'

Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!

服务这一块咱是起来了,那么去tmp瞅瞅吧,进去一看,还真是没有

看看日志吧,log里面MySQL开头的只有这一个,应该就是这个吧,打开瞅瞅

less /var/log/mysqld.log.rpmsave 

150429 09:56:41 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

进去/var/run,再按table怎么也不出来mysqld……,竟然没有这个文件夹?

那我就创建一个试试

[root@localhost tmp]# mkdir /var/run/mysqld&&touch mysqld.pid&&vim mysqld.pid





我们先把服务加进来

cd /usr/local/mysql/share/mysql

[root@localhost mysql]# cp mysql.server /etc/init.d/mysqld

chkconfig --add mysqld

chkconfig --list mysqld

chkconfig --lerels 35 mysqld on

service mysqld restart

我靠,有报错 

[root@localhost mysql]# service mysqld restart

 ERROR! MySQL manager or server PID file could not be found!

Starting MySQL. ERROR! Manager of pid-file quit without updating file.



在想起写这个记录前面还遇到两个问题,当时忘了记录……

好像有个什么 redeclaration of C++ built-in type ‘bool’