亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 16110 | 回復(fù): 6
打印 上一主題 下一主題

一次歷盡艱辛的mysql啟動經(jīng)歷 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2009-02-11 16:46 |只看該作者 |倒序瀏覽

  1. [root@testbox-04 mysql]# cat /etc/issue
  2. CentOS release 5.2 (Final)
  3. Kernel \r on an \m

  4. [root@testbox-04 mysql]# uname -r
  5. 2.6.18-92.1.22.el5
  6. [root@testbox-04 mysql]# rpm -qa | grep mysql
  7. mysql-5.0.45-7.el5
  8. mysql-server-5.0.45-7.el5
  9. mysql-5.0.45-7.el5
  10. php-mysql-5.1.6-20.el5_2.1
  11. mysql-devel-5.0.45-7.el5
  12. mysql-devel-5.0.45-7.el5
  13. mysql-test-5.0.45-7.el5
  14. mysql-bench-5.0.45-7.el5
  15. [root@testbox-04 mysql]# sestatus -bv | head -n1
  16. SELinux status:                 enabled
  17. [root@testbox-04 mysql]# sestatus -bv | grep mysql
  18. allow_user_mysql_connect               off
  19. mysqld_disable_trans                   on
復(fù)制代碼


my.cnf配置:
為了節(jié)省空間,打擾次序排序的

  1. [root@testbox-04 mysql]# grep -v "#" /etc/my.cnf | sort | uniq

  2. back_log = 50
  3. bind-address    = 192.168.12.81
  4. binlog_cache_size = 1M
  5. bulk_insert_buffer_size = 64M
  6. [client]
  7. default_table_type = INNODB
  8. ft_min_word_len = 4
  9. innodb_additional_mem_pool_size = 16M
  10. innodb_buffer_pool_size = 2G
  11. innodb_data_file_path = ibdata1:500M:autoextend
  12. innodb_data_home_dir = /var/lib/mysql/ibdata
  13. innodb_file_io_threads = 4
  14. innodb_flush_log_at_trx_commit = 1
  15. innodb_lock_wait_timeout = 120
  16. innodb_log_buffer_size = 32M
  17. innodb_log_files_in_group = 3
  18. innodb_log_file_size = 500M
  19. innodb_log_group_home_dir=/var/lib/mysql/iblogs
  20. innodb_max_dirty_pages_pct = 90
  21. innodb_thread_concurrency = 16
  22. interactive-timeout
  23. [isamchk]
  24. join_buffer_size = 8M
  25. key_buffer = 512M
  26. key_buffer_size = 32M
  27. log_long_format
  28. max_allowed_packet = 16M
  29. max_connect_errors = 10
  30. max_connections = 100
  31. max_heap_table_size = 64M
  32. [myisamchk]
  33. myisam_max_extra_sort_file_size = 10G
  34. myisam_max_sort_file_size = 10G
  35. myisam_recover
  36. myisam_repair_threads = 1
  37. myisam_sort_buffer_size = 128M
  38. [mysql]
  39. [mysqld]
  40. [mysqld_safe]
  41. [mysqldump]
  42. [mysqlhotcopy]
  43. no-auto-rehash
  44. open-files-limit = 8192
  45. port            = 3306
  46. query_cache_limit = 2M
  47. query_cache_size = 64M
  48. quick
  49. read_buffer = 8M
  50. read_buffer_size = 2M
  51. read_rnd_buffer_size = 16M
  52. server-id = 1
  53. socket          = /tmp/mysql.sock
  54. sort_buffer_size = 512M
  55. sort_buffer_size = 8M
  56. table_cache = 2048
  57. thread_cache_size = 8
  58. thread_concurrency = 8
  59. thread_stack = 192K
  60. tmp_table_size = 64M
  61. transaction_isolation = REPEATABLE-READ
  62. write_buffer = 8M
復(fù)制代碼

錯誤日志1

  1. [root@testbox-04 ~]# tail -f /var/log/mysqld.log
  2. InnoDB: in this failed attempt. InnoDB only wrote those files full of
  3. InnoDB: zeros, but did not yet use them in any way. But be careful: do not
  4. InnoDB: remove old data files which contain your precious data!
  5. 090210 23:25:42 [ERROR] Default storage engine (InnoDB) is not available
  6. 090210 23:25:42 [ERROR] Aborting

  7. 090210 23:25:42 [Note] /usr/libexec/mysqld: Shutdown complete

  8. 090210 23:25:42  mysqld ended
復(fù)制代碼


解決錯誤1:
my.cnf 里面打開
innodb_data_home_dir = /var/lib/mysql/ibdata

錯誤日志2:

  1. 090210 23:26:59  mysqld started
  2. InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
  3. InnoDB: 640 pages (rounded down to MB) than specified in the .cnf file:
  4. InnoDB: initial 32000 pages, max 0 (relevant if non-zero) pages!
  5. InnoDB: Could not open or create data files.
  6. InnoDB: If you tried to add new data files, and it failed here,
  7. InnoDB: you should now edit innodb_data_file_path in my.cnf back
  8. InnoDB: to what it was, and remove the new ibdata files InnoDB created
  9. InnoDB: in this failed attempt. InnoDB only wrote those files full of
  10. InnoDB: zeros, but did not yet use them in any way. But be careful: do not
  11. InnoDB: remove old data files which contain your precious data!
  12. 090210 23:27:00 [ERROR] Can't start server : Bind on unix socket: Permission denied
  13. 090210 23:27:00 [ERROR] Do you already have another mysqld server running on socket: /tmp/mysql.sock ?
  14. 090210 23:27:00 [ERROR] Aborting
復(fù)制代碼


解決錯誤日志2
sealert -a /var/log/audit/audit.log
查看到selinux 阻止 mysqld 讀取mysql.sock 文件,
Detailed Description:

SELinux has denied mysqld access to potentially mislabeled file(s) (mysql.sock).
This means that SELinux will not allow mysqld to use these files. It is common
for users to edit files in their home directory or tmp directories and then move
(mv) them to system directories. The problem is that the files end up with the
wrong file context which confined applications are not allowed to access.

Allowing Access:

If you want mysqld to access this files, you need to relabel them using
restorecon -v 'mysql.sock'. You might want to relabel the entire directory using
restorecon -R -v '<Unknown>'.

由于mysql無法啟動,無法產(chǎn)生mysql.sock
所以,暫時取消對mysqld監(jiān)控

setsebool mysqld_disable_trans 1

錯誤日志3

  1. 090210 23:29:42  mysqld started
  2. 090210 23:29:42  InnoDB: Operating system error number 2 in a file operation.
  3. InnoDB: The error means the system cannot find the path specified.
  4. InnoDB: If you are installing InnoDB, remember that you must create
  5. InnoDB: directories yourself, InnoDB does not create them.
  6. InnoDB: File name /var/lib/mysql/ibdata/ibdata1
  7. InnoDB: File operation call: 'create'.
  8. InnoDB: Cannot continue operation.
  9. 090210 23:29:42  mysqld ended
復(fù)制代碼


解決錯誤3:
rm -rf /var/lib/mysql/ibdata/*
rm -rf /var/lib/mysql/iblogs/*

錯誤日志4:

  1. 090210 23:52:21  mysqld started
  2. 090210 23:52:22  InnoDB: Started; log sequence number 0 43656
  3. 090210 23:52:23 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
  4. 090210 23:52:23  mysqld ended
復(fù)制代碼


解決方法4:
[root@testbox-04 /]# /usr/bin/mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

錯誤日志5:

  1. 090211 00:00:34  mysqld started
  2. 090211  0:00:35  InnoDB: Started; log sequence number 0 43656
  3. /usr/libexec/mysqld: File './mysql-bin.000008' not found (Errcode: 13)
  4. 090211  0:00:35 [ERROR] Failed to open log (file './mysql-bin.000008', errno 13)
  5. 090211  0:00:35 [ERROR] Could not open log file
  6. 090211  0:00:35 [ERROR] Can't init tc log
  7. 090211  0:00:35 [ERROR] Aborting
復(fù)制代碼


解決錯誤5:
感覺到是讀取bin-log錯誤,為什么開啟會讀bin-log
而且,我的/var/lib/mysql下  mysql-bin.000008文件是存在的
先注釋掉my.cnf  log-bin

錯誤日志6:

  1. 090211 00:23:19  mysqld started
  2. /usr/libexec/mysqld: File '/var/lib/mysql/testbox-04-slow.log' not found (Errcode: 13)
  3. 090211  0:23:19 [ERROR] Could not use /var/lib/mysql/testbox-04-slow.log for logging (error 13). Turning logging off for the whole duration of the MySQL server process. To turn it on again: fix the cause, shutdown the MySQL server and restart it.
  4. 090211  0:23:20  InnoDB: Started; log sequence number 0 43656
復(fù)制代碼


解決錯誤6:
#log_slow_queries
#long_query_time = 2
以上2行增加注釋;

錯誤日志7:

  1. 090211 00:02:51  mysqld started
  2. 090211  0:02:52  InnoDB: Started; log sequence number 0 43656
  3. 090211  0:02:52 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
  4. 090211  0:02:52 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
  5. 090211  0:02:52 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
  6. 090211 00:02:52  mysqld ended
復(fù)制代碼


解決錯誤方法6:
/usr/bin/mysql_install_db  --user=mysql


哈哈:起來了

[root@testbox-04 mysql]# service mysqld start
Starting MySQL:                                            [  OK  ]
[root@testbox-04 mysql]#



上面的前提是注釋掉了selinux對mysql的mysql.sock監(jiān)控
現(xiàn)在把監(jiān)控加進去,在做如下測試。
還是起不來,看這個樣子是selinux嚴格的權(quán)限禁止 原生目錄/var/lib/mysql下的sock文件產(chǎn)生
那更改/etc/my.cnf

  1. [root@testbox-04 mysql]# grep -v "#" /etc/my.cnf |grep -i sock
  2. socket          = /var/lib/mysql/mysql.sock
  3. socket          = /var/lib/mysql/mysql.sock
  4. 改到/var/lib/mysql下吧

  5. 重新加監(jiān)控進去
  6. [root@testbox-04 mysql]# setsebool mysqld_disable_trans 0

  7. [root@testbox-04 mysql]# ls -lZ |grep sock
  8. srwxrwxrwx  mysql mysql user_u:object_r:mysqld_var_run_t mysql.sock

  9. 090211 00:42:48  mysqld started
  10. 090211  0:42:49  InnoDB: Started; log sequence number 0 43656
  11. 090211  0:42:49 [Note] /usr/libexec/mysqld: ready for connections.
  12. Version: '5.0.45'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution
復(fù)制代碼


以上雖然是小問題,可能大家都會遇到到,希望對大家有所幫助!

論壇徽章:
0
2 [報告]
發(fā)表于 2009-02-11 16:49 |只看該作者
呵呵,樓主辛苦了!

論壇徽章:
1
白銀圣斗士
日期:2015-11-23 08:33:04
3 [報告]
發(fā)表于 2009-02-11 16:55 |只看該作者
暈。。你這等于重裝。。。。是一個空白的DB。

論壇徽章:
0
4 [報告]
發(fā)表于 2009-02-11 16:57 |只看該作者
原帖由 楓影誰用了 于 2009-2-11 16:55 發(fā)表
暈。。你這等于重裝。。。。是一個空白的DB。


啊,忘記說了,新裝的服務(wù)器
新裝的mysql

論壇徽章:
0
5 [報告]
發(fā)表于 2009-02-13 11:10 |只看該作者
看得頭大了 @_@

論壇徽章:
0
6 [報告]
發(fā)表于 2009-12-15 20:25 |只看該作者
樓主好樣的,selinux真是讓人又愛又恨啦

論壇徽章:
8
綜合交流區(qū)版塊每周發(fā)帖之星
日期:2015-12-02 15:03:53數(shù)據(jù)庫技術(shù)版塊每日發(fā)帖之星
日期:2015-10-02 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-10-02 06:20:00IT運維版塊每日發(fā)帖之星
日期:2015-09-14 06:20:00金牛座
日期:2014-10-10 11:23:34CU十二周年紀念徽章
日期:2013-10-24 15:41:34酉雞
日期:2013-10-19 10:17:1315-16賽季CBA聯(lián)賽之北京
日期:2017-03-06 15:12:44
7 [報告]
發(fā)表于 2009-12-16 08:16 |只看該作者
原帖由 liheng 于 2009-12-15 20:25 發(fā)表
樓主好樣的,selinux真是讓人又愛又恨啦



LZ解決問題過程的方法還是很不錯的
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP