Warning: Undefined array key "cperpage" in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 255

Warning: Undefined variable $output in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 325

Warning: Undefined variable $fixed_tags in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 326

Warning: Undefined variable $isshowdots in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 327

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 330

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 333

Warning: Undefined variable $tag_aditional in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 336

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $post in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Attempt to read property "ID" on null in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345

Warning: Undefined variable $more_text_link in /www/wwwroot/www.now163.com/wp-content/themes/twentytwentyfive/functions.php on line 345
数据库 – 理想社会

分类: 数据库

  • shell脚本监控mysql服务器状态

    目的:
    1.监控mysql服务器的状态
    2.当发现mysql down机就自动重启mysql服务
    3.重启mysql不成功,发邮件给管理员警告mysql down机

    #vi /usr/local/sbin/sbin/check_mysql.sh
    (更多…)

  • mysql慢查询日志分析

    mysql有一个功能就是可以log下来运行的比较慢的sql语句,默认是没有这个log的,为了开启这个功能,要修改my.cnf或者在mysql启动的时候加入一些参数。
    如果在my.cnf里面修改,需增加如下几行
    long_query_time = 10
    log-slow-queries =

    long_query_time 是指执行超过多久的sql会被log下来,这里是10秒。
    log-slow-queries 设置把日志写在那里,为空的时候,系统会给慢查询日志赋予主机名,并被附加slow.log
    (更多…)

  • MySql性能的检查和调优方法

    我一直是使用mysql这个数据库软件,它工作比较稳定,效率也很高。在遇到严重性能问题时,一般都有这么几种可能:

    1、索引没有建好;
    2、sql写法过于复杂;
    3、配置错误;
    4、机器实在负荷不了;

    1、索引没有建好

    如果看到mysql消耗的cpu很大,可以用mysql的client工具来检查。 (更多…)

  • mysql alter 语句用法,添加、修改、删除字段【转】

    一,连接MySQL

    格式:mysql -h 远程主机地址 -u 用户名 -p 回车

    输入密码进入:

    mysql -u root -p 回车

    Enter password: ,输入密码就可以进入

    mysql> 进入了

    退出命令:>exit 或者ctrl+D

    二,MySQL管理与授权

    1.修改密码:

    格式:mysqladmin -u 用户名 -p 旧密码 password 新密码

    2.增加新用户:

    >grant create,select,update….(授予相关的操作权限)

    ->on 数据库.*

    -> to 用户名@登录主机 identified by ‘密码’

    操作实例:

    给root用户添加密码:

    # mysqladmin -u root password 52netseek (更多…)