创建mysql用户 [root@xuhost opt]# useradd -g mysql mysql3307 -s /bin/nologin -d /usr/local/mysql3307
创建数据目录 [root@xuhost opt]# mkdir /mysqldata/dirdata/mysql3307 [root@xuhost opt]# chown mysql.mysql -R /mysqldata/dirdata/mysql3307
安装 cmake
复制启动脚本
[root@xuhost mysql- 5.5.9]# cp support-files/mysql.server /etc/init.d/mysqld[root@xuhost mysql- 5.5.9 ]# chmod /etc/init.d/mysqld初始化数据库 (进到安装目录)
[root@xuhost mysql5. 5.9 ]# ./scripts/mysql_install_db –user=mysql –ldata=/ var /mysql启动数据库
[root@xuhost mysql5. 5.9 ]# /etc/init.d/mysqld startMyslq 5.5 . 以上版本编译出现错误汇总:
CMake Warning: The var iable, 'MYSQL_USER' , specified manually, was not used during the generation.
需要把预编译里面的MYSQL_USER去掉,即可预编译成功!