mysql> update user set host='localhost' where user='beyes' and password='';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> select host, user, password from user;
+---------------+-------+-------------------------------------------+
| host | user | password |
+---------------+-------+-------------------------------------------+
| localhost | root | *90427DDE5E6F5547DA40AAF767C2DBA1ACCAB588 |
| linux-beyes | root | |
| 127.0.0.1 | root | |
| 192.168.2.165 | beyes | *886EDAF45559DD3029BF938188B17C51243D68F9 |
| localhost | beyes | |
+---------------+-------+-------------------------------------------+
/sbin/service mysql restart
beyes@linux-beyes:~/Desktop> mysql -hlocalhost -ubeyes -p******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.0.67 SUSE MySQL RPM
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
[quote]mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| beyes_db |
| mysql |
| phpwind |
| test |
+--------------------+
5 rows in set (0.00 sec)
mysql> use phpwind
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-------------------+
| Tables_in_phpwind |
+-------------------+
| pw_actions |
| pw_activity |
| pw_actmember |
| pw_administrators |
| pw_adminlog |
| pw_adminset |
| pw_announce |
| pw_argument |
| pw_attachbuy |
| pw_attachs |
... ... ...
+-------------------+
100 rows in set (0.00 sec)
mysql> show columns from pw_posts;
+------------+-----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+-----------------------+------+-----+---------+----------------+
| pid | int(10) unsigned | NO | PRI | NULL | auto_increment |
| fid | smallint(6) unsigned | NO | MUL | 0 | |
| tid | mediumint(8) unsigned | NO | MUL | 0 | |
| aid | text | NO | | NULL | |
| author | varchar(15) | NO | | | |
| ... ... ... ...(太多省略)
+------------+-----------------------+------+-----+---------+----------------+
25 rows in set (0.00 sec)
mysql> explain pw_posts tid;
+-------+-----------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------------------+------+-----+---------+-------+
| tid | mediumint(8) unsigned | NO | MUL | 0 | |
+-------+-----------------------+------+-----+---------+-------+
1 row in set (0.00 sec)
mysql> select author from pw_posts;
+--------+
| author |
+--------+
| beyes |
| beyes |
| beyes |
| beyes |
| lid4ji |
... ...( 省略 )
| beyes |
411 rows in set (0.00 sec)
mysql> select pid, author, postdate from pw_posts;
+------+--------+------------+
| pid | author | postdate |
+------+--------+------------+
| 1797 | beyes | 1234947213 |
| 1671 | beyes | 1230821696 |
| 1670 | beyes | 1230808918 |
| 1796 | beyes | 1234880514 |
| 1795 | beyes | 1234709520 |
... ... ...(省略)
+------+--------+------------+
411 rows in set (0.00 sec)
mysql> select * from pw_posts where author="root";
+------+-----+-----+-----+--------+----------+------+------------+---------+-----------+--------+-----+-----------+------------+-----------+--------+-----------+-----------+---------+------------+--------+----------+----------+-----------+--------+
| pid | fid | tid | aid | author | authorid | icon | postdate | subject | userip | ifsign | buy | alterinfo | remindinfo | leaveword | ipfrom | ifconvert | ifwordsfb | ifcheck | content | ifmark | ifreward | ifshield | anonymous | ifhide |
+------+-----+-----+-----+--------+----------+------+------------+---------+-----------+--------+-----+-----------+------------+-----------+--------+-----------+-----------+---------+------------+--------+----------+----------+-----------+--------+
| 1986 | 41 | 870 | | root | 274 | 0 | 1245489364 | | 127.0.0.1 | 1 | | | | | ???? | 1 | 1 | 1 | i am root! | | 0 | 0 | 0 | 0 |
+------+-----+-----+-----+--------+----------+------+------------+---------+-----------+--------+-----+-----------+------------+-----------+--------+-----------+-----------+---------+------------+--------+----------+----------+-----------+--------+
1 row in set (0.00 sec)
+-----------------+
| userip |
+-----------------+
| 124.66.48.186 |
| 121.34.176.129 |
| 121.34.48.126 |
| 124.66.51.51 |
| 124.66.51.168 |
| 124.66.51.168 |
| 117.24.64.98 |
... ... ...
+-----------------+
413 rows in set (0.00 sec)
mysql> select author, userip from pw_posts where author='lid4ji';
+--------+---------------+
| author | userip |
+--------+---------------+
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
+--------+---------------+
8 rows in set (0.00 sec)
mysql> select author, userip from pw_posts where author in ('lid4ji','root');
+--------+---------------+
| author | userip |
+--------+---------------+
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| lid4ji | 116.25.151.79 |
| root | 127.0.0.1 |
+--------+---------------+
9 rows in set (0.00 sec)
mysql> select author, fid, userip from pw_posts where fid between 23 and 51;
+--------+-----+-----------------+
| author | fid | userip |
+--------+-----+-----------------+
| beyes | 36 | 124.66.48.186 |
| beyes | 24 | 121.34.176.129 |
| beyes | 23 | 121.34.48.126 |
| beyes | 36 | 124.66.51.51 |
... ... ...
| beyes | 41 | 127.0.0.1 |
| ??? | 41 | 127.0.0.1 |
| root | 41 | 127.0.0.1 |
+--------+-----+-----------------+
370 rows in set (0.01 sec)
mysql> select author, userip from pw_posts where author like '秦%';
+--------------+-----------------+
| author | userip |
+--------------+-----------------+
| 秦荷朵朵 | 121.230.11.23 |
| 秦荷朵朵 | 121.230.11.23 |
| 秦荷朵朵 | 121.230.11.23 |
| 秦荷朵朵 | 121.230.11.156 |
| 秦荷朵朵 | 121.230.11.156 |
... ... ...
| 秦荷朵朵 | 121.230.2.153 |
| 秦荷朵朵 | 121.230.2.153 |
| 秦荷朵朵 | 121.230.8.43 |
+--------------+-----------------+
41 rows in set (0.00 sec)
mysql> select author, authorid, userip from pw_posts where author like '秦%' and userip like '%23';
+--------------+----------+-----------------+
| author | authorid | userip |
+--------------+----------+-----------------+
| 秦荷朵朵 | 11 | 121.230.11.23 |
| 秦荷朵朵 | 11 | 121.230.11.23 |
| 秦荷朵朵 | 11 | 121.230.11.23 |
| 秦荷朵朵 | 11 | 121.230.251.223 |
| 秦荷朵朵 | 11 | 121.230.251.223 |
| 秦荷朵朵 | 11 | 121.230.251.223 |
| 秦荷朵朵 | 11 | 121.230.251.223 |
+--------------+----------+-----------------+
7 rows in set (0.00 sec)
select xxx from pw_posts where ( author like '%ro%' and authorid <>10 ) or userip like '%23%';
mysql> select author as 作者 from pw_posts where author='秦荷朵朵';
+--------------+
| 作者 |
+--------------+
| 秦荷朵朵 |
| 秦荷朵朵 |
| 秦荷朵朵 |
| 秦荷朵朵 |
+--------------+
41 rows in set (0.00 sec)
mysql> select * from pw_administrators;
+-----+-----------------+---------+--------+
| uid | username | groupid | groups |
+-----+-----------------+---------+--------+
| 1 | admin | 3 | |
| 2 | bibiyaki | 17 | |
| 8 | 我家的小鸟 | -1 | ,17, |
| 9 | natu | -1 | ,17, |
| 10 | beyes | 18 | |
| 11 | 秦荷朵朵 | 3 | |
| 5 | 星凌化心 | 16 | |
| 6 | 星鬼 | 16 | |
| 14 | 贰贰 | 16 | |
| 37 | 都没小脑袋 | 6 | |
| 48 | bibiyaki2 | -1 | ,17, |
| 147 | 泰光采德 | 6 | |
| 192 | 都没大脑袋 | 6 | |
| 234 | 分水娴 | 6 | |
| 238 | 香阳学 | 6 | |
| 268 | mikibobo | 16 | |
| 269 | sofeiya | 16 | |
| 275 | lid4ji | 18 | ,5, |
| 273 | l4nneret | 7 | |
+-----+-----------------+---------+--------+
mysql> select pw_posts.author, userip, pw_administrators.uid from pw_posts,pw_administrators where pw_posts.author='秦荷朵朵' and pw_administrators.username='秦荷朵朵';
+--------------+-----------------+-----+
| author | userip | uid |
+--------------+-----------------+-----+
| 秦荷朵朵 | 121.230.11.23 | 11 |
| 秦荷朵朵 | 121.230.11.23 | 11 |
| 秦荷朵朵 | 121.230.11.23 | 11 |
| 秦荷朵朵 | 121.230.11.156 | 11 |
| 秦荷朵朵 | 121.230.11.156 | 11 |
... ... ...
+--------------+-----------------+-----+
41 rows in set (0.00 sec)
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |