linux下mysql的安装编译问题总结
2013-10-24 10:14
771 查看
(一)
#./configure --prefix=/usr/local/mysql-5.1.54
(mysql指定路径安装报错:)
如下:
checking for termcap functions library... configure: error: No
curses/termcap library found
安装:
ncurses-devel.***.rpm 包解决
#cd /media/CentOS_5.5_Final/CentOS/
#ls ncurses-devel*
找到这个包并用rpm安装。
# rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm
(或者去下载一个ncurses-5.6.tar.gz,
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
解压并安装)
(二)
make时出错
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] 错误 127
make[1]: Leaving directory
`/usr/local/src/mysql/mysql-5.1.32/mysys`
make: *** [all-recursive] 错误 1
解决:
#yum install gcc-c++ 可解决问题。
重新指定安装路径:
#./configure --prefix=/usr/local/mysql-5.0.90
make
make install
?
-----------------------------------------------------------
gcc -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -I.
-I../../include -I../../include -I../../include
-I../.. -g
-O2 -DUNIV_LINUX -MT tilde.o
-MD -MP -MF .deps/tilde.Tpo -c -o tilde.o tilde.c
在包含自 tilde.c:55 的文件中:
xmalloc.h:29:31: 错误:readline/rlstdc.h:没有那个文件或目录
make[2]: *** [tilde.o] 错误 1
make[2]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/cmd-line-utils/readline'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/cmd-line-utils'
make: *** [all-recursive] 错误 1
解决方法:
在linux下编译时,如果出现错误:readline/readline.h:没有那个文件或目录
可以直接更新
yum install
readline-devel
然后再重新编译即可。
在包含自 libmysql.c:30 的文件中:
../include/violite.h:98:30: 错误:openssl/opensslv.h:没有那个文件或目录
../include/violite.h:114:25: 错误:openssl/ssl.h:没有那个文件或目录
../include/violite.h:115:25: 错误:openssl/err.h:没有那个文件或目录
In file included from libmysql.c:30:
../include/violite.h:127: 错误:expected specifier-qualifier-list
before ‘SSL_CTX’
make[2]: *** [libmysql.lo] 错误 1
make[2]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/libmysql'
make[1]: *** [all] 错误 2
make[1]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/libmysql'
make: *** [all-recursive] 错误 1
yum install openssl*
(三)
初始化数据库时出错:
# scripts/mysql_install_db --user=mysql
或
#bin/mysql_install_db --basedir=/usr/local/mysql-5.1.54
--datadir=/usr/local/mysql-5.1.54/data --user=mysql
[Warning] '--skip-locking' is deprecated and will be removed in a
future release. Please use '--skip-
external-locking' instead.
?
(解决方法:将my.cnf 中的'--skip-locking' 换成'--skip-external-locking'
就可以了。)
?
(四)修改/etc/my.cnf 的配置文件:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir=/usr/local/mysql-5.1.54
datadir=/usr/local/mysql-5.1.54/data
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with
SQL
#safe-updates
(五:提示:)
出错时,可及时查看错误日志:
vi /usr/local/mysql-5.1.54/data/localhost.localdomain.err
显示如下:
110107 22:06:31 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.1.54/data
110107 22:06:31 [Warning] '--skip-locking' is deprecated and will
be removed in a future release. Please use
'--skip-external-locking' instead.
/usr/local/mysql-5.1.54/libexec/mysqld: Table 'mysql.plugin'
doesn't exist
110107 22:06:31 [ERROR] Can't open the mysql.plugin table. Please
run mysql_upgrade to create it.
110107 22:06:31 [ERROR] Can't start server : Bind on unix socket:
No such file or directory
110107 22:06:31 [ERROR] Do you already have another mysqld server
running on socket: var/lib/mysql/mysql.sock
?
110107 22:06:31 [ERROR] Aborting
?
小结1:
mysql 的启动方式:
(1)
#cd /usr/local/mysql-5.1.54/libexec
#./mysqld --defaults-file=../my.cnf --user=mysql
(2)
#cd /usr/local/mysql-5.1.54/bin
#./mysqld_safe --defaults-file=../my.cnf --user=mysql
(3)
#mysql -S /tmp/mysql.sock
(4)
#cd /usr/local/mysql-5.1.54/share/mysql
#./mysql.server start
(可以将mysql添加的系统服务中)
#cp ./mysql.server /etc/init.d/mysql
#chkconfig --add mysql
#service mysql start
#./configure --prefix=/usr/local/mysql-5.1.54
(mysql指定路径安装报错:)
如下:
checking for termcap functions library... configure: error: No
curses/termcap library found
安装:
ncurses-devel.***.rpm 包解决
#cd /media/CentOS_5.5_Final/CentOS/
#ls ncurses-devel*
找到这个包并用rpm安装。
# rpm -ivh ncurses-devel-5.5-24.20060715.i386.rpm
(或者去下载一个ncurses-5.6.tar.gz,
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
解压并安装)
(二)
make时出错
../depcomp: line 571: exec: g++: not found
make[1]: *** [my_new.o] 错误 127
make[1]: Leaving directory
`/usr/local/src/mysql/mysql-5.1.32/mysys`
make: *** [all-recursive] 错误 1
解决:
#yum install gcc-c++ 可解决问题。
重新指定安装路径:
#./configure --prefix=/usr/local/mysql-5.0.90
make
make install
?
-----------------------------------------------------------
gcc -DMYSQL_CLIENT_NO_THREADS -DHAVE_CONFIG_H -DNO_KILL_INTR -I.
-I../../include -I../../include -I../../include
-I../.. -g
-O2 -DUNIV_LINUX -MT tilde.o
-MD -MP -MF .deps/tilde.Tpo -c -o tilde.o tilde.c
在包含自 tilde.c:55 的文件中:
xmalloc.h:29:31: 错误:readline/rlstdc.h:没有那个文件或目录
make[2]: *** [tilde.o] 错误 1
make[2]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/cmd-line-utils/readline'
make[1]: *** [all-recursive] 错误 1
make[1]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/cmd-line-utils'
make: *** [all-recursive] 错误 1
解决方法:
在linux下编译时,如果出现错误:readline/readline.h:没有那个文件或目录
可以直接更新
yum install
readline-devel
然后再重新编译即可。
在包含自 libmysql.c:30 的文件中:
../include/violite.h:98:30: 错误:openssl/opensslv.h:没有那个文件或目录
../include/violite.h:114:25: 错误:openssl/ssl.h:没有那个文件或目录
../include/violite.h:115:25: 错误:openssl/err.h:没有那个文件或目录
In file included from libmysql.c:30:
../include/violite.h:127: 错误:expected specifier-qualifier-list
before ‘SSL_CTX’
make[2]: *** [libmysql.lo] 错误 1
make[2]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/libmysql'
make[1]: *** [all] 错误 2
make[1]: Leaving directory
`/root/nginx/mysql-5.5.3-m3/libmysql'
make: *** [all-recursive] 错误 1
yum install openssl*
(三)
初始化数据库时出错:
# scripts/mysql_install_db --user=mysql
或
#bin/mysql_install_db --basedir=/usr/local/mysql-5.1.54
--datadir=/usr/local/mysql-5.1.54/data --user=mysql
[Warning] '--skip-locking' is deprecated and will be removed in a
future release. Please use '--skip-
external-locking' instead.
?
(解决方法:将my.cnf 中的'--skip-locking' 换成'--skip-external-locking'
就可以了。)
?
(四)修改/etc/my.cnf 的配置文件:
[client]
#password = your_password
port = 3306
socket = /tmp/mysql.sock
# Here follows entries for some specific programs
# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
basedir=/usr/local/mysql-5.1.54
datadir=/usr/local/mysql-5.1.54/data
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 1M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with
SQL
#safe-updates
(五:提示:)
出错时,可及时查看错误日志:
vi /usr/local/mysql-5.1.54/data/localhost.localdomain.err
显示如下:
110107 22:06:31 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.1.54/data
110107 22:06:31 [Warning] '--skip-locking' is deprecated and will
be removed in a future release. Please use
'--skip-external-locking' instead.
/usr/local/mysql-5.1.54/libexec/mysqld: Table 'mysql.plugin'
doesn't exist
110107 22:06:31 [ERROR] Can't open the mysql.plugin table. Please
run mysql_upgrade to create it.
110107 22:06:31 [ERROR] Can't start server : Bind on unix socket:
No such file or directory
110107 22:06:31 [ERROR] Do you already have another mysqld server
running on socket: var/lib/mysql/mysql.sock
?
110107 22:06:31 [ERROR] Aborting
?
小结1:
mysql 的启动方式:
(1)
#cd /usr/local/mysql-5.1.54/libexec
#./mysqld --defaults-file=../my.cnf --user=mysql
(2)
#cd /usr/local/mysql-5.1.54/bin
#./mysqld_safe --defaults-file=../my.cnf --user=mysql
(3)
#mysql -S /tmp/mysql.sock
(4)
#cd /usr/local/mysql-5.1.54/share/mysql
#./mysql.server start
(可以将mysql添加的系统服务中)
#cp ./mysql.server /etc/init.d/mysql
#chkconfig --add mysql
#service mysql start
相关文章推荐
- linux下mysql的安装编译问题总结
- linux安装mysql客户端问题总结
- [学习linux]Ubuntu kylin 16.04下安装mysql 问题及总结
- linux下安装mysql问题总结
- Linux下编译安装MySQL问题
- linux下安装LAMP-----mysql遇到问题总结
- linux 编译安装php及编译安装mysql常见错误总结及解决办法
- linux下安装mysql问题总结(一)mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended
- linux下安装cmake和mysql遇到的问题总结
- Linux下编译安装MySQL步骤和问题解决
- linux下安装cmake和mysql遇到的问题总结
- Linux系统下自行编译安装MySQL及基础配置全过程解析
- Ubuntu17.10下安装和编译caffe问题总结
- linux重新编译安装gd,增加freetype支持,解决验证码不显示问题,Fatal error: Call to undefined function imagettftext()
- linux——编译内核时出现过的问题总结
- linux编译安装mysql
- linux下安装mysql及mysql.sock问题
- Linux使用rpm方式安装MySQL时异常总结
- Linux下源码编译MySQL 5.5 与安装程全记录
- Ubuntu 系统编译安装 pidgin 2.5.0 问题总结