编译安装遇到的错误:
进入mysql目录
[[email protected] software]# cd mysql-5.6.19
[[email protected] mysql-5.5.11]# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/home/mydb -DMYSQL_UNIX_ADDR=/home/mydb/mysqld.sock -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DMYSQL_TCP_PORT=3306 -DEXTRA_CHARSETS=all -DMYSQL_USER=mysql
出现以下错误提示:
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:250 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
解决方法:
[[email protected] mysql-5.5.11]# rm CMakeCache.txt
[[email protected] mysql-5.5.11]# yum install ncurses-devel
Warning: Bison executable not found in PATH
-- Configuring done
-- Generating done
-- Build files have been written to: /software/mysql-5.5.11
[[email protected] mysql-5.5.11]# yum install bison
[[email protected] mysql-5.5.11]# make && make install
编译完成。
初始化数据scripts/mysql_install_db --user=mysql --datadir=/home/mydb
mysql启动遇错误:
[[email protected] mysql]# service mysql restart
Starting MySQL...The server quit without updating PID file (/usr/local/mysql/data/snsgou.pid).[失败]
1、数据目录可能没有写权限
解决方法 :给予权限,执行 “chown -R mysql:mysql /var/data” “chmod -R 755 /usr/local/mysql/data” 然后重新启动mysqld!
2、可能进程里已经存在mysql进程
解决方法:用命令“ps -ef|grep mysqld”查看是否有mysqld进程,如果有使用“kill -9 进程号”杀死,然后重新启动mysqld!
3、可能是第二次在机器上安装mysql,有残余数据影响了服务的启动。
解决方法:去mysql的数据目录/data看看,如果存在mysql-bin.index文件。就赶快把它删除掉吧,它就是罪魁祸首了。
4、mysql在启动时没有指定配置文件时会使用/etc/my.cnf配置文件,请打开这个文件查看在[mysqld]节下有没有指定数据目录(datadir)。
解决方法:请在[mysqld]下设置这一行:datadir = /usr/local/mysql/data
5、skip-federated字段问题
解决方法:检查一下/etc/my.cnf文件中有没有没被注释掉的skip-federated字段,如果有就立即注释掉吧。
6、可能使my.cnf中重新定义了innodb共享表空间ibdata文件,而数据目录中已经存在innodb数据存储文件ibdata
解决方法:删除innodb的 ib开头的文件然后重新启动mysqld
[[email protected] ~]# service mysqld start
Starting MySQL..The server quit without updating PID file (/home/mydb/mysql.master.com.pid).[失败]
旧的/etc/my.cnf文件有问题