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';
相关文档:
上篇我们学会了如何创建一个数据库和数据库表,并知道如何向数据库表中添加记录。
那么我们如何从数据库表中检索数据呢?
1、从数据库表中检索信息
实际上,前面我们已经用到了SELECT语句,它用来从数据库表中检索信息。
select语句格式一般为:
SELECT 检索关键词 from 被检索的表 WHERE 检索条件( ......
在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 ......
MYSQL where id in问题
SELECT * from product WHERE id IN (‘1522,1523,1524′)ORDER BY id DESC
在MYSQL里面执行这个语句只返回1522的值。
执行
SELECT * from product WHERE instr(‘1522,1523,1524′,id) ORDER BY id DESC
或者
SELECT * from product WHERE instr(‘1522,1523,1524 ......
在你的程式中使用數據庫是個不錯的注意。如果已經有可用的MySQL服務器,在VC中可以按照如下方法實現與數據庫的駁接。
1、找來MySQL(Win32)安裝目錄下的include文件夾, 將其添加到VC頭文件目 ......
http://www.cnblogs.com/amboyna/archive/2009/11/16/1603867.html
有一段日子了,曾经设置了一次记录在mysql中查询慢于1秒钟的SQL语句。刚才突然回想设置的方法,有几个参数的名称死活回忆不起来了,于是重新整理一下,自己做个笔记。
对于排查问题找出性能瓶颈来说,最容易发现并解决的问题就是MYSQL的慢查询以及没有得 ......