debian mysql 允许外部链接方法
1 modify the /etc/mysql/my.cnf
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
you see the bind-address, comment it. 注掉它。
2 update the database -- mysql.
shell > mysql -uroot -p
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| mysql |
+--------------------+
5 rows in set (0.00 sec)
mysql> select t.host, t.user from user t;
+-----------+------------------+
| host | user |
+-----------+------------------+
|127.0.0.1 | debian-sys-maint |
|127.0.0.1 | james |
| 127.0.0.1 | root |
| debian | root |
| localhost | root |
+-----------+------------------+
5 rows in set (0.00 sec)
mysql > update user set host='%' where user='yourUsername';
mysql > flush privileges;
remark:
if wanna create user please follow:
create user 'james'@'%' identified by 'password';
相关文档:
Query Cache 在提高数据库性能方面具有非常重要的作用。
其设定也非常简单,仅需要在配置文件写入两行: query_cache_type 和 query_cache _size,而且 MySQL 的 query cache 非常快!而且一旦命中,就直接发送给客户端,节约大量的 CPU 时间。
当然,非 SELECT 语句对缓冲是有影响的,它们可能使缓冲中的数据过期。一个 ......
在mysql的slow query log中,可能存在类似这样的特殊记录:
# Time: 100127 23:17:01
# User@Host: root[root] @ [127.0.0.1]
# Query_time: 18446744073709.351562 Lock_time: 0.000129 Rows_sent: 1 Rows_examined: 11030
SET timestamp=1264663021;
SELECT dummy.id AS dummy_id
from dummy&nbs ......
我的系统是redhat as5 建议大家完全安装,以免安装时缺少相关的编译器等等。
一、安装mysql(mysql-5.0.21.tar.gz)
# tar zxf mysql-5.0.21.tar.gz
# cd mysql-5.0.21
#./configure --prefix=/usr/local/mysql --sysconfdir=/etc --localstatedir=/var/lib/mysql/
说明:
#prefix=/usr/lo ......
mysql
有一个功能就是可以log下来运行的比较慢的sql语句,默认是没有这个log的,为了开启这个功能,要修改my.cnf或者在mysql
启动的时候加入一些参数。
如果在my.cnf里面修改,需增加如下几行
long_query_time = 10
log-slow-queries =
long_query_time
是指执行超过多久的sql会被log下来,这里是10秒。
log-slo ......