LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 624|回复: 6

GENTOO 配置启动MYSQL失败,求助.

[复制链接]
发表于 2011-10-22 15:19:29 | 显示全部楼层 |阅读模式
# /etc/init.d/mysql start 启动失败

/etc/mysql/my.cnf文件配置信息

  1. # /etc/mysql/my.cnf: The global mysql configuration file.
  2. # $Header: /var/cvsroot/gentoo-x86/dev-db/mysql/files/my.cnf-5.1,v 1.2 2010/03/24 18:26:09 robbat2 Exp $

  3. # The following options will be passed to all MySQL clients
  4. [client]
  5. #password                                        = your_password
  6. port                                                = 3306
  7. socket                                                = /var/run/mysqld/mysqld.sock

  8. [mysql]
  9. character-sets-dir=/usr/share/mysql/charsets
  10. default-character-set=utf8

  11. [mysqladmin]
  12. character-sets-dir=/usr/share/mysql/charsets
  13. default-character-set=utf8

  14. [mysqlcheck]
  15. character-sets-dir=/usr/share/mysql/charsets
  16. default-character-set=utf8

  17. [mysqldump]
  18. character-sets-dir=/usr/share/mysql/charsets
  19. default-character-set=utf8

  20. [mysqlimport]
  21. character-sets-dir=/usr/share/mysql/charsets
  22. default-character-set=utf8

  23. [mysqlshow]
  24. character-sets-dir=/usr/share/mysql/charsets
  25. default-character-set=utf8

  26. [myisamchk]
  27. character-sets-dir=/usr/share/mysql/charsets

  28. [myisampack]
  29. character-sets-dir=/usr/share/mysql/charsets

  30. # use [safe_mysqld] with mysql-3
  31. [mysqld_safe]
  32. err-log                                                = /var/log/mysql/mysql.err

  33. # add a section [mysqld-4.1] or [mysqld-5.0] for specific configurations
  34. [mysqld]
  35. character-set-server                = utf8
  36. user                                                 = mysql
  37. port                                                 = 3306
  38. socket                                                 = /var/run/mysqld/mysqld.sock
  39. pid-file                                         = /var/run/mysqld/mysqld.pid
  40. log-error                                         = /var/log/mysql/mysqld.err
  41. basedir                                         = /usr
  42. datadir                                         = /usr/mysql/data
  43. skip-external-locking
  44. key_buffer                                         = 16M
  45. max_allowed_packet                         = 1M
  46. table_cache                                 = 64
  47. sort_buffer_size                         = 512K
  48. net_buffer_length                         = 8K
  49. read_buffer_size                         = 256K
  50. read_rnd_buffer_size                 = 512K
  51. myisam_sort_buffer_size         = 8M
  52. language                                         = /usr/share/mysql/english

  53. # security:
  54. # using "localhost" in connects uses sockets by default
  55. # skip-networking
  56. bind-address                                = 127.0.0.1

  57. log-bin
  58. server-id                                         = 1

  59. # point the following paths to different dedicated disks
  60. tmpdir                                                 = /tmp/
  61. #log-update                                 = /path-to-dedicated-directory/hostname

  62. # you need the debug USE flag enabled to use the following directives,
  63. # if needed, uncomment them, start the server and issue
  64. # #tail -f /tmp/mysqld.sql /tmp/mysqld.trace
  65. # this will show you *exactly* what's happening in your server ;)

  66. #log                                                = /tmp/mysqld.sql
  67. #gdb
  68. #debug                                                = d:t:i:o,/tmp/mysqld.trace
  69. #one-thread

  70. # uncomment the following directives if you are using BDB tables
  71. #bdb_cache_size                                = 4M
  72. #bdb_max_lock                                = 10000

  73. # the following is the InnoDB configuration
  74. # if you wish to disable innodb instead
  75. # uncomment just the next line
  76. #skip-innodb
  77. #
  78. # the rest of the innodb config follows:
  79. # don't eat too much memory, we're trying to be safe on 64Mb boxes
  80. # you might want to bump this up a bit on boxes with more RAM
  81. innodb_buffer_pool_size = 16M
  82. # this is the default, increase it if you have lots of tables
  83. innodb_additional_mem_pool_size = 2M
  84. #
  85. # i'd like to use /var/lib/mysql/innodb, but that is seen as a database :-(
  86. # and upstream wants things to be under /var/lib/mysql/, so that's the route
  87. # we have to take for the moment
  88. innodb_data_home_dir                = /usr/mysql/data #/var/lib/mysql/
  89. innodb_log_arch_dir                = /usr/mysql/data #/var/lib/mysql/
  90. innodb_log_group_home_dir        = /usr/mysql/data #/var/lib/mysql/
  91. # you may wish to change this size to be more suitable for your system
  92. # the max is there to avoid run-away growth on your machine
  93. innodb_data_file_path = ibdata1:10M:autoextend:max:128M
  94. # we keep this at around 25% of of innodb_buffer_pool_size
  95. # sensible values range from 1MB to (1/innodb_log_files_in_group*innodb_buffer_pool_size)
  96. innodb_log_file_size = 5M
  97. # this is the default, increase it if you have very large transactions going on
  98. innodb_log_buffer_size = 8M
  99. # this is the default and won't hurt you
  100. # you shouldn't need to tweak it
  101. innodb_log_files_in_group=2
  102. # see the innodb config docs, the other options are not always safe
  103. innodb_flush_log_at_trx_commit = 1
  104. innodb_lock_wait_timeout = 50
  105. innodb_file_per_table

  106. [mysqldump]
  107. quick
  108. max_allowed_packet                         = 16M

  109. [mysql]
  110. # uncomment the next directive if you are not familiar with SQL
  111. #safe-updates

  112. [isamchk]
  113. key_buffer                                         = 20M
  114. sort_buffer_size                         = 20M
  115. read_buffer                                 = 2M
  116. write_buffer                                 = 2M

  117. [myisamchk]
  118. key_buffer                                         = 20M
  119. sort_buffer_size                         = 20M
  120. read_buffer                                 = 2M
  121. write_buffer                                 = 2M

  122. [mysqlhotcopy]
  123. interactive-timeout

复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2011-10-22 19:52:28 | 显示全部楼层
:yun::yun::yun::yun: 么有人帮助下么..
回复 支持 反对

使用道具 举报

发表于 2011-10-22 20:29:47 | 显示全部楼层
貌似gentoo自带了两个mysql的启动脚本,试试另外一个。
回复 支持 反对

使用道具 举报

发表于 2011-10-22 21:55:31 | 显示全部楼层
看错误日志啊
回复 支持 反对

使用道具 举报

发表于 2011-10-25 02:56:50 | 显示全部楼层
http://www.gentoo.org/doc/en/mysql-howto.xml
你需要做mysql的初始化。
emerge --config =dev-db/mysql-[version]
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-10-25 11:02:49 | 显示全部楼层
苍天啊,大地啊. 怎么会这样呢. 郁闷...

  1. kelvin mysql # emerge --config =dev-db/mysql-5.1.56


  2. Configuring pkg...

  3. * MySQL MY_DATADIR has changed
  4. * from /var/lib/mysql
  5. * to /usr/mysql/data
  6. * Both /var/lib/mysql and /usr/mysql/data exist
  7. * Attempting to use /usr/mysql/data and preserving /var/lib/mysql
  8. * You have already a MySQL database in place.
  9. * (///usr/mysql/data/*)
  10. * Please rename or delete it if you wish to replace it.
  11. * ERROR: dev-db/mysql-5.1.56 failed (config phase):
  12. *   MySQL database already exists!
  13. *
  14. * Call stack:
  15. *     ebuild.sh, line   56:  Called pkg_config
  16. *   environment, line 4166:  Called mysql_pkg_config
  17. *   environment, line 3664:  Called die
  18. * The specific snippet of code:
  19. *           die "MySQL database already exists!";
  20. *
  21. * If you need support, post the output of 'emerge --info =dev-db/mysql-5.1.56',
  22. * the complete build log and the output of 'emerge -pqv =dev-db/mysql-5.1.56'.
  23. * This ebuild is from an overlay named 'gentoo': '/var/db/pkg/'
  24. * The complete build log is located at '/var/tmp/portage/dev-db/mysql-5.1.56/temp/build.log'.
  25. * The ebuild environment file is located at '/var/tmp/portage/dev-db/mysql-5.1.56/temp/environment'.
  26. * S: '/var/tmp/portage/dev-db/mysql-5.1.56/work/mysql-5.1.56'

复制代码
回复 支持 反对

使用道具 举报

发表于 2011-10-25 16:18:47 | 显示全部楼层
呃,提示不是写得很清楚了嘛?需要您将/usr/mysql/data/中的内容删除或移走。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表