标签 mysql 下的文章

mysql问题记录

[Err] 1153 – Got a packet bigger than ‘max_allowed_packet’ bytes
[Err] /*Data for the table `bodycontent` */
insert into `bodycontent`(`BODYCONTENTID`,`BODY`,`CONTENTID`) values (98305,'{note:title=Installing Plugins}nnThe plugins featured on this page are not installed out-of-the-box. To install them, please refer to our documentation on +[installing plugins|http://confluence.atlassian.com/x/loBQ]+.nn{note}’,32776),(98306,'{section}n{column:width=1px}n{panel}n{gallery:columns=2|include=RefinedWiki.jpg,ThemeBuilder.png|sort=name}n\\{_}Click to enlarge{_}\\n{panel}n{column}n{column}nYou have +[a number of options|http://confluence.atlassian.com/display/CONFHOST/Skinning+Confluence]+ for completely customising the look and feel of Confluence. Below, we’ve highlighted the most popular options for skinning Confluence for use as a corporate intranet.nnh5. RefinedWiki Original ThemennRefinedWikis Original Theme is a plugin which gives Confluence a whole new design and makes it easier for your company to collaborate and share documents.nnWatch the video >>:n{widget:url=http://app.episodic.com/shows/13/episodes/pskcvfyj8x1p}nnn(i) [*Learn more*|https://plugins.atlassian.com/plugin/details/15231]nnh5. ThemeBuildernnIf you are looking to build your own theme, the Theme Builder plugin allows you to add and customise logo banners, menu-driven navigation, style sheets, footers and more…nn(i) [*Learn more*|http://www.adaptavist.com/display/ADAPTAVIST/Builder]n{column}n{section}’,32788),(98307,'{excerpt}n{section}n{column:width=1px}n{panel}n[!_Balsamiq – Demonstration Space – Extranet.jpg|width=403,height=308!|http://www.youtube.com/watch?v=e7htdJCvkeQ]n{panel}n{column}n{column}nEver heard the saying _’a picture is worth a thousand words’_? Using the +[Balsamiq Mockups Plugin|https://plugins.atlassian.com/plugin/details/256]+ you can create and visualise mockups of diagrams for proposed layouts of website content, new features, and much more, right within Confluence.nnh5. How can you use it?nn* Our ‘Development Team’ uses Balsamiq to mockup new features for our products. The Balsamiq Mockup below eventuated in the new Image Browser that shipped in Confluence 3.1.n* Our ‘Marketing Team’ use Balsamiq to create mockups of pages for our website in Confluence. The mockups are then given to our ‘Web Team’ to implement.n\\nnh5. How to add a Mockup to an existing pagenn# *Hover your cursor* over the _Add_ menu on any Confluence pagen# *Select* *{_}UI Mockup{_}*n# *Use the Balsamiq Web-based editor* to complete your mockupn# Once you’ve completed your mockup, *select* *{_}Save and Close{_}* *from the* *{_}Mockup{_}* *menu in the top-left of the Balsamiq editor*nnnh5. Import Existing MockupsnnYou can [+reuse a whole bunch of Mockups+|http://mockupstogo.net/] that have been contributed by the community.n{column}n{section}n{excerpt}nn(!) The Gliffy and Balsamiq plugins are pre-installed with Confluence Hosted Evaluations.’,32785),(98308,'{include:_Installing Plugins}n—-n{anchor:top}n{section}nn{column}n{panel}nnh5. Manage Tasksn_Focus on getting things done_n\\n[!TaskDock.png|border=1,width=200,height=150!|#tsk]n[*{+}Learn how >>+*|#tsk]nn{panel}n{column}nn{column}n{panel}nnh5. Skin & Theme Your Intranetn_Customise Confluence_n\\n[!IntranetTheme.png|border=1,width=200,height=150!|#the]n[*{+}Learn how >>+*|#the]nnn{panel}n{column}nn{column}n{panel}nnh5. Smartphone Applicationsn_Confluence on your mobile device_n\\n[!mini_confluence_1.png|border=1,width=200,height=150!|#mob]n[*{+}Learn how >>+*|#mob]nnn{panel}n{column}nn{column}n{panel}nnh5. Other Cool Pluginsn_Diagrams and Mockups_n\\n[!Gliffy.png|border=1,width=200,height=150!|#oth]n[*{+}Learn how >>+*|#oth]nnn{panel}n{column}n{section}n—-n{anchor:tsk}nnh1. Manage tasks and get everyone involvedn{include:_TaskDock}n[_Back to top_|#top]nnnn{anchor:the}nnh1. Skin and theme your intranetn{include:_Themes}n[_Back to top_|#top]nnn{anchor:mob}nnh1. Set up Confluence on your mobile devicen{include:_Mo
[Msg] Finished – Unsuccessfully
————————————————–
[Err] 2006 – MySQL server has gone away
[Err] /*Data for the table `bodycontent` */
insert into `bodycontent`(`BODYCONTENTID`,`BODY`,`CONTENTID`) values (98305,'{note:title=Installing Plugins}nnThe plugins featured on this page are not installed out-of-the-box. To install them, please refer to our documentation on +[installing plugins|http://confluence.atlassian.com/x/loBQ]+.nn{note}’,32776),(98306,'{section}n{column:width=1px}n{panel}n{gallery:columns=2|include=RefinedWiki.jpg,ThemeBuilder.png|sort=name}n\\{_}Click to enlarge{_}\\n{panel}n{column}n{column}nYou have +[a number of options|http://confluence.atlassian.com/display/CONFHOST/Skinning+Confluence]+ for completely customising the look and feel of Confluence. Below, we’ve highlighted the most popular options for skinning Confluence for use as a corporate intranet.nnh5. RefinedWiki Original ThemennRefinedWikis Original Theme is a plugin which gives Confluence a whole new design and makes it easier for your company to collaborate and share documents.nnWatch the video >>:n{widget:url=http://app.episodic.com/shows/13/episodes/pskcvfyj8x1p}nnn(i) [*Learn more*|https://plugins.atlassian.com/plugin/details/15231]nnh5. ThemeBuildernnIf you are looking to build your own theme, the Theme Builder plugin allows you to add and customise logo banners, menu-driven navigation, style sheets, footers and more…nn(i) [*Learn more*|http://www.adaptavist.com/display/ADAPTAVIST/Builder]n{column}n{section}’,32788),(98307,'{excerpt}n{section}n{column:width=1px}n{panel}n[!_Balsamiq – Demonstration Space – Extranet.jpg|width=403,height=308!|http://www.youtube.com/watch?v=e7htdJCvkeQ]n{panel}n{column}n{column}nEver heard the saying _’a picture is worth a thousand words’_? Using the +[Balsamiq Mockups Plugin|https://plugins.atlassian.com/plugin/details/256]+ you can create and visualise mockups of diagrams for proposed layouts of website content, new features, and much more, right within Confluence.nnh5. How can you use it?nn* Our ‘Development Team’ uses Balsamiq to mockup new features for our products. The Balsamiq Mockup below eventuated in the new Image Browser that shipped in Confluence 3.1.n* Our ‘Marketing Team’ use Balsamiq to create mockups of pages for our website in Confluence. The mockups are then given to our ‘Web Team’ to implement.n\\nnh5. How to add a Mockup to an existing pagenn# *Hover your cursor* over the _Add_ menu on any Confluence pagen# *Select* *{_}UI Mockup{_}*n# *Use the Balsamiq Web-based editor* to complete your mockupn# Once you’ve completed your mockup, *select* *{_}Save and Close{_}* *from the* *{_}Mockup{_}* *menu in the top-left of the Balsamiq editor*nnnh5. Import Existing MockupsnnYou can [+reuse a whole bunch of Mockups+|http://mockupstogo.net/] that have been contributed by the community.n{column}n{section}n{excerpt}nn(!) The Gliffy and Balsamiq plugins are pre-installed with Confluence Hosted Evaluations.’,32785),(98308,'{include:_Installing Plugins}n—-n{anchor:top}n{section}nn{column}n{panel}nnh5. Manage Tasksn_Focus on getting things done_n\\n[!TaskDock.png|border=1,width=200,height=150!|#tsk]n[*{+}Learn how >>+*|#tsk]nn{panel}n{column}nn{column}n{panel}nnh5. Skin & Theme Your Intranetn_Customise Confluence_n\\n[!IntranetTheme.png|border=1,width=200,height=150!|#the]n[*{+}Learn how >>+*|#the]nnn{panel}n{column}nn{column}n{panel}nnh5. Smartphone Applicationsn_Confluence on your mobile device_n\\n[!mini_confluence_1.png|border=1,width=200,height=150!|#mob]n[*{+}Learn how >>+*|#mob]nnn{panel}n{column}nn{column}n{panel}nnh5. Other Cool Pluginsn_Diagrams and Mockups_n\\n[!Gliffy.png|border=1,width=200,height=150!|#oth]n[*{+}Learn how >>+*|#oth]nnn{panel}n{column}n{section}n—-n{anchor:tsk}nnh1. Manage tasks and get everyone involvedn{include:_TaskDock}n[_Back to top_|#top]nnnn{anchor:the}nnh1. Skin and theme your intranetn{include:_Themes}n[_Back to top_|#top]nnn{anchor:mob}nnh1. Set up Confluence on your mobile devicen{include:_Mo
[Msg] Finished – Unsuccessfully
————————————————–
百度相关问题就行

linux下用rpm安装mysql

下载地址:http://dev.mysql.com/downloads/mysql/5.1.html,打开网址,找到linux generic项,里面找到5.5.25_x86_64版本下载,需下载两个文件:
MySQL-client-5.5.25a-1.linux2.6.x86_64
MySQL-server-5.5.25a-1.linux2.6.x86_64
1、安装server端:
[root@host127 mysql_5.5.25]# rpm -ivh MySQL-server-5.5.25a-1.linux2.6.x86_64.rpm
Preparing… ########################################### [100%]
ls: cannot access /var/lib/mysql/*.err: No such file or directory
ls: cannot access /var/lib/mysql/*.err: No such file or directory
1:MySQL-server ########################################### [100%]
有以上信息显示为数据库安装成功。
测试是否成功可运行netstat看Mysql端口是否打开,如打开表示服务已经启动,安装成功。Mysql默认的端口是3306。
[root@host127 mysql]# netstat -nat
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:55982 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5672 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 248 172.21.48.127:22 172.21.35.203:1930 ESTABLISHED
tcp 0 0 172.21.48.127:22 172.21.35.203:2163 ESTABLISHED
tcp 0 0 :::111 :::* LISTEN
tcp 0 0 :::35056 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:631 :::* LISTEN
tcp 0 0 :::12865 :::* LISTEN
2、安装client端
[root@host127 mysql_5.5.25]# rpm -ivh MySQL-client-5.5.25a-1.linux2.6.x86_64.rpm
Preparing… ########################################### [100%]
package MySQL-client-5.5.25a-1.linux2.6.x86_64 is already installed
有以上信息,也表示数据库client端安装成功。
3、登陆Mysql
用下面的命令连接mysql,测试是否成功。
登陆Mysql的命令是mysql,mysql的初始管理账号是root,没有密码。
[root@host127 mysql_5.5.25]# mysql
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 3
Server version: 5.5.25a MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the current input statement.
mysql>

MYSQL索引在查询中如何使用?

假如你有一个表,
SQL> CREATE TABLE test_tab (
2 id INT,
3 name VARCHAR(10),
4 age INT,
5 val VARCHAR(10)
6 );
你的业务,有一个查询,是
SELECT * FROM test_tab WHERE name = 一个外部输入的数据
刚开始,数据不多的时候,执行效果还不错。
随着数据量的增加,这个查询,执行起来,越来越慢了。
然后在 name 上面 建立了索引
CREATE INDEX idx_test4_name ON test_tab (name );
这样, 可以加快前面那个查询的速度。
但是,某天,你执行了下面这个SQL, 发现速度又慢了
SELECT * FROM test_tab WHERE age = 25
为啥呢? 因为 age 字段上面,没有索引
索引只在 name 上面有
换句话说, 也就是 WHERE 里面的条件, 会自动判断,有没有 可用的索引,如果有, 该不该用。
多列索引,就是一个索引,包含了2个字段。
例如:
CREATE INDEX idx_test_name_age ON test_tab (name, age);
那么
SELECT * FROM test_tab
WHERE
name LIKE ‘张%’
AND age = 25
这样的查询,将能够使用上面的索引。
多列索引,还有一个可用的情况就是, 某些情况下,可能查询,只访问索引就足够了, 不需要再访问表了。例如:
SELECT
AVG( avg ) AS 平均年龄
FROM
test_tab
WHERE
name LIKE ‘张%’
这个时候, name 与 age 都包含在索引里面。 查询不需要去检索表中的数据。

mysql语句大全

选择:
select * from user where user.id=1;
插入:
insert into user(user.id,user.name,user.pwd) values('3','testname','testpwd')
insert into booktest(booktest.id,booktest.name,booktest.price,booktest.userid) values(1,'好书名',15,null)
删除:
delete from user where id=3
更新:
update user set user.name='updatename' where user.id=2
Like语句:
select * from user where user.name like '%name%'
排序:
select * from user order by user.id desc
总数:
select count(*) from user
求和:
select sum(book.price) from book
平均:
select avg(book.price) from book
最大:
select max(book.price) from book
最小:
select min(book.price) from book
left join:
select * from user u left join book b on u.id=b.userid;
Group by:
select u.id,u.name,count(*) from user u left join book b on u.id=b.userid group by u.id;
IN:
select * from book where price in(25,10)
NOT IN:
select * from book where price not in(25,10)
子查询:
select * from user where user.id in(select book.userid from book)
Between:
select * from book where book.price between 5 and 30
时间函数:
select DAYOFWEEK('1998-02-03');
select WEEKDAY('1997-10-04 22:23:00');
创建表
CREATE TABLE booktest (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(1024) NOT NULL,
price int(10) not null,
userid int(10)
)
TABLESPACE ts_1 STORAGE DISK
ENGINE NDBCLUSTER;

单机版和集群MySQL cluster数据导入导出

导出要用到MySQL的mysqldump工具,windows和linux下都经过测试
单机版和集群MySQL cluster导入导出方式都是一样的。
几个常用用例:
1.导出整个数据库
mysqldump -u 用户名 -p 数据库名 > 导出的文件名
mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql
2.导出一个表
mysqldump -u 用户名 -p 数据库名 表名> 导出的文件名
mysqldump -u wcnc -p smgp_apps_wcnc users> wcnc_users.sql
3.导出一个数据库结构
mysqldump -u wcnc -p -d –add-drop-table smgp_apps_wcnc >d:wcnc_db.sql
-d 没有数据 –add-drop-table 在每个create语句之前增加一个drop table
4.导入数据库
常用source 命令
进入mysql数据库控制台,
如mysql -u root -p
mysql>use 数据库
然后使用source命令,后面参数为脚本文件(如这里用到的.sql)
mysql>source d:wcnc_db.sql
5.远程导出数据库
mysqldump -u root -h 172.21.33.75 -p test > e:sqlbaktest.sql