首页 > √linux, √文章精选 > 一些小问题
viyin.net

一些小问题

2010年4月6日 发表评论 阅读评论

1)问题描述:如果多个帐户都用root 来登录 怎么看另一个用户使用的那些命令

解决方法:vi /etc/profile

增加以下内容:

export PROMPT_COMMAND=’{ date “+[ %Y%m%d %H:%M:%S `whoami` ] `history 1 | { read x cmd; echo “$cmd from ip:$SSH_CLIENT $SSH_TTY”; }`”; }>> /home/pu/login.log’

保存退出,通过source /etc/profile立即生效!

需要注意的事,有可能通过open-ssh客户端软件登陆后,环境变量PROMPT_COMMAND 还是,保持默认值,只需要退出,然后,重新登陆即可.

2010-04-2

1)问题描述:scp 如何拷贝目录

答:scp -r 目录名 user@ip:/user

2010-04-06

1)问题描述:linux下挂载usb设备,一个u盘对应4个part问题,用fdisk -l 显示如下信息:

Disk /dev/sdb: 1023 MB, 1023409152 bytes
32 heads, 61 sectors/track, 1023 cylinders
Units = cylinders of 1952 * 512 = 999424 bytes
This doesn’t look like a partition table
Probably you selected the wrong device.

Device Boot Start End Blocks Id System
/dev/sdb1 ? 398636 983425 570754815+ 72 Unknown
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(357, 116, 40) logical=(398635, 6, 23)
Partition 1 has different physical/logical endings:
phys=(357, 32, 45) logical=(983424, 30, 61)
Partition 1 does not end on cylinder boundary.
/dev/sdb2 ? 86419 1078237 968014120 65 Novell Netware 386
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(288, 115, 43) logical=(86418, 26, 1)
Partition 2 has different physical/logical endings:
phys=(367, 114, 50) logical=(1078236, 17, 53)
Partition 2 does not end on cylinder boundary.
/dev/sdb3 ? 957932 1949749 968014096 79 Unknown
Partition 3 has different physical/logical beginnings (non-Linux?):

解决方法:重新分区,fdisk /dev/sda ,先删除四个分区,然后在重新新建一个主分区,按W保存退出,用mkfs.ext3 进行格式化.

2)问题描述:mysql binlog日志非常大,如何删除,如:

mysql>show binary logs;

1.1G mysql-bin.000319
1.1G mysql-bin.000320
1.1G mysql-bin.000321
1.1G mysql-bin.000322
1.1G mysql-bin.000323
1.1G mysql-bin.000324
1.1G mysql-bin.000325
1.1G mysql-bin.000326
1.1G mysql-bin.000327
1.1G mysql-bin.000328
1.1G mysql-bin.000329
1.1G mysql-bin.000330

解决方法:

#purge master logs to ‘mysql-bin.000330′; (方法1)

#purge binary logs to ‘mysql-bin.000330′; (方法2)

#方法三:

配置my.cnf,增加expire_logs_days=10

如果在运行状态下修改,set global expire_logs_days=10;

转载:http://blog.myspace.cn/e/406829013.htm
感谢木易水平

viyin.net
分类: √linux, √文章精选 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.