Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Now it's MySQL's turn...

Some problems encounted this afternoon, when trying to setup/test mysql capabilities on hypnos and virgil.
1.ERROR 2003 (HY000): Can't connect to MySQL server on 'server-name' (111)
access locally (i.e. from localhost) is fine, when trying remotely got this error. when tried with mysql++ library, got the following:
terminate called after throwing an instance of 'mysqlpp::ConnectionFailed'
  what():  Can't connect to MySQL server on 'hypnos' (111)
After some searches, it appears this is just indicate network issue, not to do with mysql authentication.
TWO
most likely reasons are:
 a.
with --skip-networking
on it will
not accept TCP/IP connections at all.
 b. with
--bind-address=127.0.0.1
, it
will listen for TCP/IP connections only locally on the
loopback interface and will not accept remote connections.

did find skip-networking option from mysql-workbench and it's off, not find bind-address at all from intotal maybe hundreds options, but it turned out it IS bind-address THE ARCH CRIMINAL!!!
solution: comments out bind-address=127.0.0.1
from /etc/mysql/my.cnf
Some other tips came across during the search
2. UFW -- The default firewall configuration tool for Ubuntu.
https://help.ubuntu.com/community/UFW
http://blog.bodhizazen.net/linux/firewall-ubuntu-gufw/
http://blog.bodhizazen.net/linux/fir...untu-desktops/
http://blog.bodhizazen.net/linux/fir...buntu-servers/
example:
To allow/deny incoming tcp and
udp packet on port 53
sudo ufw allow/deny 53
example:
To allow/deny incoming tcp packets on port 53
sudo ufw allow/deny 53/tcp
example:
To allow/deny incoming udp packes on port 53
sudo ufw allow/deny 53/udp
3. Error communicating with gnome-keyring-daemon, when initially using mysql-workbench
to connect to mysql database
a good collection of threads:
http://ubuntuforums.org/showthread.php?p=9359283
1)
gnome-keyring-daemon
is a pie


Ïà¹ØÎĵµ£º

»ùÓÚMySQLºÍInfobrightµÄÊý¾Ý²Ö¿â¼¼Êõ

»ùÓÚMySQLºÍInfobrightµÄÊý¾Ý²Ö¿â¼¼Êõ
Êý¾Ý²Ö¿â/·ÖÎö/ÉÌÎñÖÇÄÜ( BI )ÁìÓòÕýÔÚ·ÉËÙ·¢Õ¹¡£ÔÚ¼¤Áҵľ­¼Ã¾ºÕùÖÐËùÓÐÐÐÒµºÍÖÇÄÜÆóÒµÐèÒªÀûÓÃÆäÄÚ²¿µÄÊý¾ÝÀ´×ö³öÖØÒªµÄÉÌÒµ¾ö²ß£¬°üÀ¨Õ½ÊõºÍÕ½ÂÔÁ½·½Ã棬ÒÔ±£³ÖÐÐÒµµÄÁìÏȵØÎ»¡£
Êý¾Ý²Ö¿â(Èç¶ÔMySQLµÄÒ»´ÎÖØ´óÉç»áºÍ¿Í»§µ÷²é)ĿǰÊÇMySQLµÄµÚÎåÖÖ×î³£¼ûµÄÓ¦Óá£ÏÖÔÚÓÃÓÚMySQLÊý¾Ý ......

JDBC ¼òµ¥µÄMysqlÁ¬½Ó

/*ÑÝʾһ¸öJDBC³ÌÐò£¬´ÓMysqlµÄLMDÊý¾Ý¿âÖжÁ³ö±íadminµÄÒ»¸öÐÅÏ¢*/
import java.sql.*;
public class TestMysqlConnection {
    public static void main(String[] args) {
        Connection conn = null;
        Statement stmt = ......

MySQL replace into Ó÷¨


ÔÚÏò±íÖвåÈëÊý¾ÝµÄʱºò£¬¾­³£Óöµ½ÕâÑùµÄÇé¿ö£º1. Ê×ÏÈÅжÏÊý¾ÝÊÇ·ñ´æÔÚ£» 2. Èç¹û²»´æÔÚ£¬Ôò²åÈ룻3.Èç¹û´æÔÚ£¬Ôò¸üС£
ÔÚ SQL Server ÖпÉÒÔÕâÑù´¦Àí£º
if not exists (select 1 from t where id = 1) insert into t(id, update_time) values(1, getdate()) else update t set update_time = getdate() where id = ......

Mysql´íÎ󼯽õ£¨Linux£©


 
1£º Can’t connect to [local] MySQL server´íÎó
Ò»¸öMySQL¿Í»§¿ÉÒÔÁ½ÖÖ²»Í¬µÄ·½Ê½Á¬½Ómysqld·þÎñÆ÷£ºUnixÌ×½Ó×Ö£¬Ëüͨ¹ýÔÚÎļþϵͳÖеÄÒ»¸öÎļþ(ȱʡ“/tmp /mysqld.sock”)½øÐÐÁ¬½Ó£»»òTCP/IP£¬Ëüͨ¹ýÒ»¸ö¶Ë¿ÚºÅÁ¬½Ó¡£UnixÌ×½Ó×Ö±ÈTCP/IP¸ü¿ì£¬µ«ÊÇÖ»ÓÐÓÃÔÚÁ¬½Óͬһ̨¼ÆËã»úÉϵķþÎñÆ÷¡£Èç¹ûÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ