Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4263051
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: Mysql/postgreSQL

2011-08-04 12:26:22

介绍mysql物理结构

包含四种主要的数据文件
    1. 日志文件  包括错误日志、
    2. 数据文件 
    3. 复制相关文件
    4. 其他小文件






下面的操作先介绍 错误日志 的使用

1. 首先 我们没有指定 --log-error 文件,那么会默认生成一个 hostname.err
的日志文件

  1. ywx@ywx:/opt/mysql5151$ ./bin/mysqld_safe --defaults-file=./my.cnf --user=ywx &
  2. [1] 10331
  3. ywx@ywx:/opt/mysql5151$ 110804 12:15:15 mysqld_safe Logging to

  4. '/opt/mysql5151/data/ywx.err'.  生成的路径
  5. 110804 12:15:15 mysqld_safe Starting mysqld daemon with databases from /opt/mysql5151/data

  6. ywx@ywx:/opt/mysql5151$ ./bin/mysql --defaults-file=./my.cnf
  7. Welcome to the MySQL monitor. Commands end with ; or \g.
  8. Your MySQL connection id is 1
  9. Server version: 5.1.51bbk Source distribution

  10. Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
  11. This software comes with ABSOLUTELY NO WARRANTY. This is free software,
  12. and you are welcome to modify and redistribute it under the GPL v2 license

  13. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

  14. 指定了默认的 错误日志文件
  15. mysql> show variables like '%error%'; 参看日志文件路径
  16. +--------------------+-----------------------------+
  17. | Variable_name | Value |
  18. +--------------------+-----------------------------+
  19. | error_count | 0 |
  20. | log_error | /opt/mysql5151/data/ywx.err |
  21. | max_connect_errors | 10 |
  22. | max_error_count | 64 |
  23. | slave_skip_errors | OFF |
  24. +--------------------+-----------------------------+
  25. 5 rows in set (0.00 sec)
  26. mysql> system hostname
  27. ywx


2. 如果我们指定了 --log-error

  1. ywx@ywx:/opt/mysql5151$ ./bin/mysqld_safe --defaults-file=./my.cnf --user=ywx --log-error=/tmp/mysql3306.err &


  2. 将日志文件定位到了 /tmp/mysql3306.err 文件

  3. ywx@ywx:/opt/mysql5151$ ps -ef | grep mysql
  4. ywx 10502 8299 0 12:20 pts/0 00:00:00 /bin/sh ./bin/mysqld_safe --defaults-

  5. file=./my.cnf --user=ywx --log-error=/tmp/mysql3306.err

  6. 错误日志文件 记录了启动记录

  7. 110804 12:20:49 mysqld_safe Starting mysqld daemon with databases from /opt/mysql5151/data
  8. 110804 12:20:49 [Warning] '--skip-locking' is deprecated and will be removed in a future

  9. release. Please use '--skip-external-locking' instead.
  10. 110804 12:20:49 InnoDB: Started; log sequence number 0 44233
  11. 110804 12:20:49 [Note] Event Scheduler: Loaded 0 events
  12. 110804 12:20:49 [Note] /opt/mysql5151/libexec/mysqld: ready for connections.
  13. Version: '5.1.51bbk' socket: '/tmp/mysql.sock' port: 3306 Source distribution

阅读(422) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~