+ -
当前位置:首页 → 问答吧 → emerge mysql 成功,但是emerge --config mysql时失败

emerge mysql 成功,但是emerge --config mysql时失败

时间:2008-03-20

来源:互联网

按照wiki上的安装wordpress,在configure mysql这一步失败

这是出错信息:·
代码:
hunk@localhost ~ $ sudo emerge --config =mysql-5.0.5*
代码:

Configuring pkg...

 * Creating the mysql database and setting proper
 * permissions on it ...
 * Insert a password for the mysql 'root' user
 * Avoid ["'\_%] characters in the password
 >
 * Retype the password
 >
 * 
 * ERROR: dev-db/mysql-5.0.56 failed.
 * Call stack:
 * ebuild.sh, line 49: Called pkg_config
 * environment, line 3307: Called mysql_pkg_config
 * environment, line 3014: Called die
 * The specific snippet of code:
 * die "Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND ${TMPDIR}/mysql_install_db.log";
 * The die message:
 * Failed to run mysql_install_db. Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mysql-5.0.56/temp/mysql_install_db.log
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/dev-db/mysql-5.0.56/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.0.56/temp/environment'.
 * This ebuild is from an overlay: '/var/db/pkg/'
 *

但是可以运行mysql,就是不能登录·
代码:
hunk@localhost ~ $ mysql -u root -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

代码:
hunk@localhost ~ $ emerge --info
Portage 2.1.4.4 (default-linux/x86/2007.0/desktop, gcc-4.2.3, glibc-2.6.1-r0, 2.6.24-gentoo-r2 i686)
=================================================================
System uname: 2.6.24-gentoo-r2 i686 Intel(R) Pentium(R) 4 CPU 3.00GHz
Timestamp of tree: Wed, 19 Mar 2008 21:30:01 +0000
ccache version 2.4 [disabled]
app-shells/bash: 3.2_p17-r1
dev-lang/python: 2.4.4-r9
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache: 2.4-r7
sys-apps/baselayout: 1.12.11.1
sys-apps/sandbox: 1.2.18.1-r2
sys-devel/autoconf: 2.13, 2.61-r1
sys-devel/automake: 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10
sys-devel/binutils: 2.18-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool: 1.5.26
virtual/os-headers: 2.6.23-r3
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks metadata-transfer parallel-fetch sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://61.135.158.199"
LANG="en_US.UTF-8"
LINGUAS="zh_CN"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/portage/local/layman/gentoo-china"
SYNC="rsync://61.135.158.199/gentoo-portage"
USE="X acl acpi alsa apache arts berkdb cairo cdr cli cracklib crypt cups dbus dri dvd dvdr dvdread eds emboss encode esd evo fam firefox fortran gdbm gif gnome gpm gstreamer gtk hal iconv ipv6 isdnlog jpeg kde kerberos ldap libwww mad midi mikmod mp3 mpeg mudflap mysql ncurses nls nptl nptlonly ogg opengl openmp oss pam pcre pdf perl php png pppd python qt3 qt3support qt4 quicktime readline reflection sdl session spell spl ssl svg tcpd tiff truetype unicode vorbis win32codecs x86 xml xorg xv zlib" ALSA_CARDS="intel8x0" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="zh_CN" USERLAND="GNU" VIDEO_CARDS="nvidia nv"
Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LDFLAGS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

作者: BzFly   发布时间: 2008-03-20

Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mysql-5.0.56/temp/mysql_install_db.log

里面都有什么?

作者: druggo   发布时间: 2008-03-20

手动安装mysql
上传的附件
mysql_setup.txt (808 字节, 13 次查看)

作者: kpld   发布时间: 2008-03-20

引用:
作者: druggo
Please review /var/log/mysql/mysqld.err AND /var/tmp/portage/dev-db/mysql-5.0.56/temp/mysql_install_db.log

里面都有什么?
/var/log/mysql/mysqld.err
代码:
cat: /var/log/mysql/mysqld.err: Permission denied
hunk@localhost ~ $ sudo cat /var/log/mysql/mysqld.err 
Password:
080320 9:07:12 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 9:07:12 [ERROR] Aborting

080320 9:07:12 [Note] /usr/sbin/mysqld: Shutdown complete

080320 9:19:01 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080320 9:19:01 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080320 9:19:01 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080320 9:19:01 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080320 9:19:02 InnoDB: Started; log sequence number 0 0
080320 9:19:02 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.54-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Gentoo Linux mysql-5.0.54
080320 9:20:36 [Note] /usr/sbin/mysqld: Normal shutdown

080320 9:20:36 InnoDB: Starting shutdown...
080320 9:20:36 InnoDB: Shutdown completed; log sequence number 0 43655
080320 9:20:36 [Note] /usr/sbin/mysqld: Shutdown complete

080320 9:22:39 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 9:22:39 [ERROR] Aborting

080320 9:22:39 [Note] /usr/sbin/mysqld: Shutdown complete

080320 9:45:29 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 9:45:29 [ERROR] Aborting

080320 9:45:29 [Note] /usr/sbin/mysqld: Shutdown complete

080320 11:29:43 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 11:29:43 [ERROR] Aborting

080320 11:29:43 [Note] /usr/sbin/mysqld: Shutdown complete

080320 11:30:15 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080320 11:30:15 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080320 11:30:15 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080320 11:30:15 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080320 11:30:16 InnoDB: Started; log sequence number 0 0
080320 11:30:16 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.56-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Gentoo Linux mysql-5.0.56
080320 11:34:19 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 11:34:19 [ERROR] Aborting

080320 11:34:19 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:09:27 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 14:09:27 [ERROR] Aborting

080320 14:09:27 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:12:04 [Note] /usr/sbin/mysqld: Normal shutdown

080320 14:12:04 [ERROR] bdb: log_archive: DB_ARCH_ABS: No such file or directory
080320 14:12:04 InnoDB: Starting shutdown...
080320 14:12:05 InnoDB: Shutdown completed; log sequence number 0 43655
080320 14:12:05 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:12:05 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080320 14:12:05 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080320 14:12:05 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080320 14:12:06 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080320 14:12:06 InnoDB: Started; log sequence number 0 0
080320 14:12:06 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.56-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Gentoo Linux mysql-5.0.56
080320 14:12:18 [Note] /usr/sbin/mysqld: Normal shutdown

080320 14:12:18 InnoDB: Starting shutdown...
080320 14:12:19 InnoDB: Shutdown completed; log sequence number 0 43655
080320 14:12:19 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:12:38 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 14:12:38 [ERROR] Aborting

080320 14:12:38 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:12:49 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
InnoDB: The first specified data file ./ibdata1 did not exist:
InnoDB: a new database to be created!
080320 14:12:49 InnoDB: Setting file ./ibdata1 size to 10 MB
InnoDB: Database physically writes the file full: wait...
080320 14:12:49 InnoDB: Log file ./ib_logfile0 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile0 size to 5 MB
InnoDB: Database physically writes the file full: wait...
080320 14:12:49 InnoDB: Log file ./ib_logfile1 did not exist: new to be created
InnoDB: Setting log file ./ib_logfile1 size to 5 MB
InnoDB: Database physically writes the file full: wait...
InnoDB: Doublewrite buffer not found: creating new
InnoDB: Doublewrite buffer created
InnoDB: Creating foreign key constraint system tables
InnoDB: Foreign key constraint system tables created
080320 14:12:50 InnoDB: Started; log sequence number 0 0
080320 14:12:50 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.0.56-log' socket: '/var/run/mysqld/mysqld.sock' port: 3306 Gentoo Linux mysql-5.0.56
080320 14:46:46 [Note] /usr/sbin/mysqld: Normal shutdown

080320 14:46:46 InnoDB: Starting shutdown...
080320 14:46:47 InnoDB: Shutdown completed; log sequence number 0 43655
080320 14:46:47 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:47:51 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 14:47:51 [ERROR] Aborting

080320 14:47:51 [Note] /usr/sbin/mysqld: Shutdown complete

080320 14:49:04 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 14:49:04 [ERROR] Aborting

080320 14:49:04 [Note] /usr/sbin/mysqld: Shutdown complete
/var/tmp/portage/dev-db/mysql-5.0.56/temp/mysql_install_db.log
代码:
hunk@localhost ~ $ sudo cat /var/tmp/portage/dev-db/mysql-5.0.56/temp/mysql_install_db.log 
Installing MySQL system tables...
080320 14:49:04 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
080320 14:49:04 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/sbin/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!

作者: BzFly   发布时间: 2008-03-20

引用:
作者: kpld
手动安装mysql
谢谢兄弟,如果问题得不到解决就只有这样了。。

作者: BzFly   发布时间: 2008-03-20

有些ERROR啊,搜搜吧
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 14:49:04 [ERROR] Aborting

作者: druggo   发布时间: 2008-03-20

看上去像密码问题……
重新emerge一下,然后搞个简单的密码config试试?

作者: jjj311   发布时间: 2008-03-20

try to remove all the files inside /var/lib/mysql ,restart the service and run the emerge --config =mysql-5.0.5 command again

作者: hihihihi   发布时间: 2008-03-20

引用:
作者: druggo
有些ERROR啊,搜搜吧
ERROR: 1062 Duplicate entry 'localhost-' for key 1
080320 14:49:04 [ERROR] Aborting
找到的这些error没有与我的是一样的,在bugs.gentoo.org里找到了相同的问题,但是可惜没有解决方案

作者: BzFly   发布时间: 2008-03-21

引用:
作者: jjj311
看上去像密码问题……
重新emerge一下,然后搞个简单的密码config试试?
两个字符的密码也不行,好像也不是密码的问题,谢谢你的建议

作者: BzFly   发布时间: 2008-03-21

引用:
作者: hihihihi
try to remove all the files inside /var/lib/mysql ,restart the service and run the emerge --config =mysql-5.0.5 command again
i have did this for several times ,but it seems not to be solved
Thank you all the same

作者: BzFly   发布时间: 2008-03-21

我遇到过同样问题,后来是手工建的用户。

作者: gorf   发布时间: 2008-03-21

引用:
作者: gorf
我遇到过同样问题,后来是手工建的用户。
没找到解决方法,把mysql删掉了,安装的postgresql。。。

作者: BzFly   发布时间: 2008-03-21

不会吧,me也too。
解决不了?

作者: 三翻领   发布时间: 2008-03-23

上面有建议说是手工建用户,可以试试。我是来得及等就装了postgresql了

作者: BzFly   发布时间: 2008-03-23

得,我用sqlite算了,还是现成的。

作者: 三翻领   发布时间: 2008-03-23

呵呵,有得用就可以了,反正在自己机器上练习用

作者: BzFly   发布时间: 2008-03-23

引用:
作者: BzFly
没找到解决方法,把mysql删掉了,安装的postgresql。。。
1, Duplicate entry 'localhost-' for key 1 问题,很可能是你的主机名有问题,比如是localhost?
导致mysql 的root 帐号的三个主机值(分别是%、localhost、主机名)的后二者的名字弄成一样了,导使唯一键值出现重复而禁用该记录了?

2, mysql 安装后,通常(mysql_install_db 后)root是无密码的,先确认你是设置过密码了
其次,再试下 mysql -u root test 试下test库以确认是否是user 库有IO问题

3, 对于已经确认是密码问题,可启用mysqld-safe 进行修改,建一个文本文件名为 mysqlfix,内容如:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('mypassword');

然后停止mysqld 运行:

mysqld_safe --init-file=~/mysqlfix &

再启动mysql 用上面设置的新密码进去。。

4, 我装的LAMP 组合就是gentoo 树里的,一路很顺风。。跑的也很欢。。没出过“奇怪”的问题

作者: arli   发布时间: 2008-03-23

可能吧,我的确是localhost
不过算了,sqlite也不错,和python的绑定也简单的,据说常用命令速度很快,就是不知道能不能担负大型数据库

作者: 三翻领   发布时间: 2008-03-23

引用:
作者: 三翻领
可能吧,我的确是localhost
不过算了,sqlite也不错,和python的绑定也简单的,据说常用命令速度很快,就是不知道能不能担负大型数据库
sqlite 读快,写并行不强(当然是综合指数,包括事务、lock等等问题)
用该库的,必须都得是“高人” 自己处理数据写队列,当然这也是一个瓶劲得以解决的迟早的根本问题,这个级别的“用户”基本上都只将数据库视为映射页存放的数据块而已。。故而不是很要担心库IO问题,因为IO调度是自己管,可以更高层次的考虑分摊硬件负载问题。

如果是我设计的项目,不大的数据源单体的,可以用sqlite,因为它的可移植性是最强的

多点数据源的或特定功能要求的(例如需要分析服务、数据挖掘)的,那肯定得用商业数据库,mysql还不成

大点的单点数据源的(比如网站类似的广播型服务),则可以选择mysql,管理起来方便,采购和人工成本还便宜。。

作者: arli   发布时间: 2008-03-23

受教了。
我主要现在在酝酿一个档案系统的应用,主要用于记录备案和查询,涉及到的字段大概7、8个,但是其中某些字段会很长。估计记录会随时间而增长,估计上千。这种情况,不知道是否世合适?
工作需要,才会涉及数据库,刚刚学了点利用python模块创建表、插入、修改等等简单操作,见笑。

作者: 三翻领   发布时间: 2008-03-23

受教了,不过我主要是用来学习,暂时什么类型的数据库对我来说没有什么区别,我想学会了基本的东西,以后应用的时候再来学这个数据库的应用。现在是入门阶段。。

作者: BzFly   发布时间: 2008-03-23