MySQL入門(教材本体)
netstat -atn
$ netstat --help 2>&1 |grep -P "\-[atn]\W" -n, --numeric don't resolve names -a, --all, --listening display all sockets (default: connected)={-t|--tcp} {-u|--udp} {-U|--udplite} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom $ netstat -an | grep -iP ":3306\s" tcp 0 0 192.168.0.110:3306 0.0.0.0:* LISTEN
テスト。
http://www.php.net/manual/ja/function.socket-listen.php
$ (php -r '$sock=socket_create(AF_INET,SOCK_STREAM,SOL_TCP);socket_bind($sock,"127.0.0.1",13579);socket_listen($sock);sleep(5);print "### PHP END!!\n";' &) && for sec in $(seq 1 10); do netstat -an | grep -iP ":13579\s"; sleep 1; echo sec=$sec; done sec=1 tcp 0 0 127.0.0.1:13579 0.0.0.0:* LISTEN sec=2 tcp 0 0 127.0.0.1:13579 0.0.0.0:* LISTEN sec=3 tcp 0 0 127.0.0.1:13579 0.0.0.0:* LISTEN sec=4 tcp 0 0 127.0.0.1:13579 0.0.0.0:* LISTEN ### PHP END!! sec=5 sec=6 sec=7 sec=8 sec=9 sec=10
似ている。
mysql> SHOW CREATE TABLE mysql.time_zone\G *************************** 1. row *************************** Table: time_zone Create Table: CREATE TABLE `time_zone` ( `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N', PRIMARY KEY (`Time_zone_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1731 DEFAULT CHARSET=utf8 COMMENT='Time zones' 1 row in set (0.01 sec) mysql> DESCRIBE mysql.time_zone; +------------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------------+------------------+------+-----+---------+----------------+ | Time_zone_id | int(10) unsigned | NO | PRI | NULL | auto_increment | | Use_leap_seconds | enum('Y','N') | NO | | N | | +------------------+------------------+------+-----+---------+----------------+ 2 rows in set (0.00 sec)
似ている。
mysql> SELECT DATABASE()\G *************************** 1. row *************************** DATABASE(): test 1 row in set (0.00 sec) mysql> \s -------------- mysql Ver 14.14 Distrib 5.1.70, for pc-linux-gnu (x86_64) using readline 5.1 Connection id: 102667 Current database: test Current user: root@localhost SSL: Not in use ...
0 件のコメント:
コメントを投稿