centos下编译安装mysql5.5/5.6

2013年11月16日 19:39:13

centos 6 mysql 5.5.28

我只说些我出错的地方:

cmake后删除的方法是 xargs rm < install_manifest.text

注意这个命令只会删除安装目录中的文件,而不会删除安装目录中的文件夹

--------------------------------

假如你安装的basedir是/usr/local/mysql

那么就粗犷的执行下 chown -R mysql.mysql /usr/local/mysql 保证所有的程序都可以被mysql这个用户执行

(数据库的数据目录,权限须设为你的mysql的系统管理用户,不能是root,一般默认是名为mysql用户)

否则执行 service mysqld start 时提示 The server quit without updating PID file 这样的错误

此时查看error.log里边显示的是 Can't start server : Bind on unix socket: Permission denied

----------------------------------------

 安装的时候可以只

cmake -DCMAKE_INSTALL_PREFIX=/******

不写其它的配置参数

安装好后再安装目录里找到配置文件自己修改相关项就行了

参考链接:

http://www.360doc.com/content/12/0304/19/2054285_191664568.shtml 

http://blog.csdn.net/zqtsx/article/details/9378703 

http://www.cnblogs.com/xiongpq/p/3384681.html

 

----------------------------------------

2014年2月15日 21:33:40

yum -y install cmake

yum -y install gcc-c++ //缺少会提示, ***_CXX_COMPLIER....缺失

yum -y install ncurses ncurses-devel //缺少时,会提示此软件的名字,复制它们再yum安装就行了



如果安装过程中失败,提示缺少其他软件,安装依赖的软件后先执行:
rm CMakeCache.txt 然后再 cmake ....

 

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/web/mysql -DEXTRA_CHARSETS=all -DDEFAULT_CHARSETS=utf8 -DDERAULT_COLLATION=utf8_general_ci

 执行 script/myslq_install_db --basedir=.... --datadiar=.... 后,提示怎样去设置密码以及怎样设置随系统启动

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system



PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:



  /usr/local/web/mysql/bin/mysqladmin -u root password 'new-password'

  /usr/local/web/mysql/bin/mysqladmin -u root -h AY1402041644126082e5Z password 'new-password'

怎样启动MYSQL以及怎样测试MYSQL

You can start the MySQL daemon with:



  cd . ; /usr/local/web/mysql/bin/mysqld_safe &



You can test the MySQL daemon with mysql-test-run.pl



  cd mysql-test ; perl mysql-test-run.pl

另外,我在执行这段安装数据库的脚本前,就已经将my-default.cnf复制到安装根目录下边并重命名为my.cnf,这时程序提示

WARNING: Found existing config file /usr/local/web/mysql/my.cnf on the system.

Because this file might be in use, it was not replaced,

but was used in bootstrap (unless you used --defaults-file)

and when you later start the server.

The new default config file was created as /usr/local/web/mysql/my-new.cnf,

please compare it with your file and take the changes you need

其实,该脚本程序创建的my-new.cnf和my-default.cnf的内容是一样的:基本上没有什么内容

在安装完成mysql,以及初始化数据库,修改用户组,安装service服务后,先不要启用新版本的my.cnf里的socket指令,否则执行mysql命令时总是提示

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

即使修改配置文件socket文件位置,重启MYSQL服务也没有(暂时还不知道为什么)

--------------------------

cmake的重要特性之一是其独立于源码(out-of-source)的编译功能,即编译工作可以在另一个指定的目录中而非源码目录中进行,这可以保证源码目录不受任何一次编译的影响,因此在同一个源码树上可以进行多次不同的编译,如针对于不同平台编译(http://www.linuxidc.com/Linux/2013-08/88664.htm)

 

 

你可能感兴趣的:(centos)