??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美有码在线观看,91精品国产综合久久精品,超碰精品在线http://www.aygfsteel.com/willpower88/category/13061.html对JAVA有点理解了…?/description>zh-cnTue, 07 Sep 2021 06:28:57 GMTTue, 07 Sep 2021 06:28:57 GMT60mysql8-root密码重置http://www.aygfsteel.com/willpower88/archive/2021/08/05/435941.html一?/dc:creator>一?/author>Thu, 05 Aug 2021 10:06:00 GMThttp://www.aygfsteel.com/willpower88/archive/2021/08/05/435941.htmlhttp://www.aygfsteel.com/willpower88/comments/435941.htmlhttp://www.aygfsteel.com/willpower88/archive/2021/08/05/435941.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/435941.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/435941.html
1、打开my.cnf 加入 skip-grant-tables
2、mysql.service stop && mysql.service start
3、清Iroot密码 q?退?br />
    update mysql.user set authentication_string='' where user='root';  
4?/span>mysql.service stop && mysql.service start
5、mysql -root   免密dq修改root密码
    alter user 'root'@'%' identified by 'pass$123';
    alter user 'root'@'localhost' identified by 'pass$123';

定是否支持q程dQhost中有%的记录即支持
select host, user, authentication_string, plugin from user;


]]>
linux mysql导出CSVhttp://www.aygfsteel.com/willpower88/archive/2015/01/22/422371.html一?/dc:creator>一?/author>Thu, 22 Jan 2015 10:55:00 GMThttp://www.aygfsteel.com/willpower88/archive/2015/01/22/422371.htmlhttp://www.aygfsteel.com/willpower88/comments/422371.htmlhttp://www.aygfsteel.com/willpower88/archive/2015/01/22/422371.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/422371.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/422371.html //mysql
 mysql -uroot -proot -h127.0.0.1 testdb -e " select a, b, c, d from t_test where a='xxxx'" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > /tmp/xxxxx.csv


]]>mysql生成随机旉http://www.aygfsteel.com/willpower88/archive/2013/12/05/407256.html一?/dc:creator>一?/author>Thu, 05 Dec 2013 08:51:00 GMThttp://www.aygfsteel.com/willpower88/archive/2013/12/05/407256.htmlhttp://www.aygfsteel.com/willpower88/comments/407256.htmlhttp://www.aygfsteel.com/willpower88/archive/2013/12/05/407256.html#Feedback1http://www.aygfsteel.com/willpower88/comments/commentRss/407256.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/407256.htmlupdate test set create_time=concat('2013-10-01 ', floor(10+rand()*10),':',floor(10+rand()*49),':',floor(10+rand()*49))  where create_time='0000-00-00 00:00:00'


]]>
mysql load data中文qhttp://www.aygfsteel.com/willpower88/archive/2013/12/02/407101.html一?/dc:creator>一?/author>Mon, 02 Dec 2013 06:52:00 GMThttp://www.aygfsteel.com/willpower88/archive/2013/12/02/407101.htmlhttp://www.aygfsteel.com/willpower88/comments/407101.htmlhttp://www.aygfsteel.com/willpower88/archive/2013/12/02/407101.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/407101.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/407101.htmlload data infile '/tmp/test.txt' into table test character set utf8 (col1,col2,col3);
l色部分在mysql参考手册中都没有描qͼ坑爹啊!Q!Q!Q!Q?/strong>

]]>
mysql 1045http://www.aygfsteel.com/willpower88/archive/2013/10/25/405634.html一?/dc:creator>一?/author>Fri, 25 Oct 2013 03:36:00 GMThttp://www.aygfsteel.com/willpower88/archive/2013/10/25/405634.htmlhttp://www.aygfsteel.com/willpower88/comments/405634.htmlhttp://www.aygfsteel.com/willpower88/archive/2013/10/25/405634.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/405634.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/405634.html
ERROR 1045 (28000): Access denied for user 'root'@'121.39.50.24' (using password: YES)
Ӟ用rootd到数据库服务器,执行Q?br />
set password for 'root'@'%'=PASSWORD('abc123');
注:有时grant授权后也不行Q必d执行如上命o

]]>
linux下导出mysql表ؓCSVhttp://www.aygfsteel.com/willpower88/archive/2013/05/08/399016.html一?/dc:creator>一?/author>Wed, 08 May 2013 10:21:00 GMThttp://www.aygfsteel.com/willpower88/archive/2013/05/08/399016.htmlhttp://www.aygfsteel.com/willpower88/comments/399016.htmlhttp://www.aygfsteel.com/willpower88/archive/2013/05/08/399016.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/399016.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/399016.html
/usr/local/mysql55/bin/mysql --defaults-file=/usr/local/mysql55/var/my.cnf -uroot -pdev -e "select * from report.appcontent into outfile '/tmp/appcontent.csv' fields terminated by ',' optionally enclosed by '\"' escaped by '\"' lines terminated by '\r\n'"


]]>
mysql5.5.28源码安装cmakehttp://www.aygfsteel.com/willpower88/archive/2013/03/13/396366.html一?/dc:creator>一?/author>Wed, 13 Mar 2013 03:24:00 GMThttp://www.aygfsteel.com/willpower88/archive/2013/03/13/396366.htmlhttp://www.aygfsteel.com/willpower88/comments/396366.htmlhttp://www.aygfsteel.com/willpower88/archive/2013/03/13/396366.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/396366.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/396366.html
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql55 \
-DDEFAULT_CHARSET=gbk \
-DDEFAULT_COLLATION=gbk_chinese_ci \
-DWITH_EXTRA_CHARSETS:STRING=gbk,gb2312,utf8 \
-DWITH_MYISAM_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/usr/local/mysql55/mysql.sock \
-DSYSCONFDIR=/usr/local/mysql55/conf \
-DMYSQL_DATADIR=/var/mysql/data

make
make install


]]>
MYSQL最大连接数?U方?/title><link>http://www.aygfsteel.com/willpower88/archive/2010/09/16/332173.html</link><dc:creator>一?/dc:creator><author>一?/author><pubDate>Thu, 16 Sep 2010 06:08:00 GMT</pubDate><guid>http://www.aygfsteel.com/willpower88/archive/2010/09/16/332173.html</guid><wfw:comment>http://www.aygfsteel.com/willpower88/comments/332173.html</wfw:comment><comments>http://www.aygfsteel.com/willpower88/archive/2010/09/16/332173.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/willpower88/comments/commentRss/332173.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/willpower88/services/trackbacks/332173.html</trackback:ping><description><![CDATA[<p><strong>Ҏ一Q?/strong></p> <p>        q入MySQL安装目录 打开MySQL配置文g my.ini ?my.cnf查找 max_connections=100 修改?max_connections=1000 Q服务里重vMySQL卛_<br />         注意Q如果新增max_connectionsQ必L在mysqld下,如:       </p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><img align="top" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #000000">  </span><span style="color: #ff0000">[</span><span style="color: #ff0000">mysqld</span><span style="color: #ff0000">]</span><span style="color: #000000"><br /> <img align="top" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" alt="" />  max_connections</span><span style="color: #808080">=</span><span style="color: #800000; font-weight: bold">300</span></div> <p><strong>Ҏ二:<br /> </strong>        dx据库Q执行以下命令:      </p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><img align="top" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #0000ff">set</span><span style="color: #000000"> GLOBAL max_connections</span><span style="color: #808080">=</span><span style="color: #800000; font-weight: bold">500</span><span style="color: #000000">;<br /> <img align="top" src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" alt="" />show variables </span><span style="color: #808080">like</span><span style="color: #000000"> </span><span style="color: #ff0000">'</span><span style="color: #ff0000">max_con%</span><span style="color: #ff0000">'</span><span style="color: #000000">;</span></div> <img src ="http://www.aygfsteel.com/willpower88/aggbug/332173.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/willpower88/" target="_blank">一?/a> 2010-09-16 14:08 <a href="http://www.aygfsteel.com/willpower88/archive/2010/09/16/332173.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MYSQL5.1安装脚本http://www.aygfsteel.com/willpower88/archive/2010/08/30/330304.html一?/dc:creator>一?/author>Mon, 30 Aug 2010 08:43:00 GMThttp://www.aygfsteel.com/willpower88/archive/2010/08/30/330304.htmlhttp://www.aygfsteel.com/willpower88/comments/330304.htmlhttp://www.aygfsteel.com/willpower88/archive/2010/08/30/330304.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/330304.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/330304.html#!/bin/bash

MYSQL_HOME
="/home/work/local/mysql5"
MYSQL_SRC_HOME
="mysql-5.1.38"

cd 
$MYSQL_SRC_HOME
make clean
./configure \
--prefix=$MYSQL_HOME \
--with-tcp-port=3308 \
--enable-thread-safe-client \
--enable-local-infile \
--with-unix-socket-path=$MYSQL_HOME/mysql.sock \
--with-charset=gbk \
--with-innodb \
--with-extra-charsets=gbk,utf8,ascii,big5,latin1 \
--enable-static \
--enable-assemble

make
make install

cd 
$MYSQL_HOME
cp 
./share/mysql/my-huge.cnf ./my.cnf

./bin/mysql_install_db
./bin/mysqld_safe &



]]>
mysql|文攉--持箋更新http://www.aygfsteel.com/willpower88/archive/2010/08/30/330280.html一?/dc:creator>一?/author>Mon, 30 Aug 2010 06:33:00 GMThttp://www.aygfsteel.com/willpower88/archive/2010/08/30/330280.htmlhttp://www.aygfsteel.com/willpower88/comments/330280.htmlhttp://www.aygfsteel.com/willpower88/archive/2010/08/30/330280.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/330280.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/330280.html

构徏高性能web之\------mysqld分离实战


 



]]>
mysql变量使用http://www.aygfsteel.com/willpower88/archive/2010/05/05/320117.html一?/dc:creator>一?/author>Wed, 05 May 2010 05:43:00 GMThttp://www.aygfsteel.com/willpower88/archive/2010/05/05/320117.htmlhttp://www.aygfsteel.com/willpower88/comments/320117.htmlhttp://www.aygfsteel.com/willpower88/archive/2010/05/05/320117.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/320117.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/320117.html参考手册里?语言l构Q?.3用户变量Q?.4pȝ变量

讄用户变量的一个途径是执?span>SET语句Q?br /> SET @var_name = expr [, @var_name = expr] ...
也可以用语句代替SET来ؓ用户变量分配一个倹{在q种情况下,分配W必Mؓ:=而不能用=Q因为在?span>SET语句?span>=被视Z个比?操作W,如下所C:
mysql> SET @t1=0, @t2=0, @t3=0;
mysql> SELECT @t1:=(@t2:=1)+@t3:=4,@t1,@t2,@t3;
对于使用select语句为变量赋值的情况Q若q回多条记录Q则变量的gؓ最后一条记录的|不过不徏议在q种情况下用;若返回结果ؓI,x有记录,此时变量的gؓ上一ơ变量赋值时的|如果没有对变量赋q|则ؓNULL?/span>

一般我们可以这么用:
set @tmp=0
select @tmp:=tmp from table_test;
set @tmp=@tmp+1

pȝ变量q接拷贝吧Q?/span>

9.4. pȝ变量

MySQL可以讉K许多pȝ和连接变量。当服务器运行时许多变量可以动态更攏V这样通常允许你修Ҏ务器操作而不需要停止ƈ重启服务器?/p>

mysqld服务器维护两U变量。全局变量影响服务器整体操作。会话变量媄响具体客Lq接的操作?/p>

当服务器启动Ӟ它将所有全局变量初始化ؓ默认倹{这些默认值可以在选项文g中或在命令行中指定的选项q行更改。服务器启动后,通过q接服务器ƈ执行SET GLOBAL var_name语句Q可以动态更改这些全局变量。要x改全局变量Q必d?span>SUPER权限?/p>

服务器还为每个连接的客户端维护一pd会话变量。在q接时用相应全局变量的当前值对客户端的会话变量q行初始化。对于动态会话变量,客户端可以通过SET SESSION var_name语句更改它们。设|会话变量不需要特D权限,但客L只能更改自己的会话变量,而不能更改其它客L的会话变量?/p>

对于全局变量的更改可以被讉K该全局变量的Q何客L看见。然而,它只影响更改后连接的客户的从该全局变量初始化的相应会话变量。不影响目前已经q接的客L的会话变?span>(即客户端执?span>SET GLOBAL语句也不影响)?/p>

可以使用几种语法形式来设|或索全局或会话变量。下面的例子使用?span>sort_buffer_sizeas作ؓCZ变量名?/p>

要想讄一?span>GLOBAL变量的|使用下面的语法:

mysql> SET GLOBAL sort_buffer_size=value;
mysql> SET @@global.sort_buffer_size=value;

要想讄一?span>SESSION变量的|使用下面的语法:

mysql> SET SESSION sort_buffer_size=value;
mysql> SET @@session.sort_buffer_size=value;
mysql> SET sort_buffer_size=value;

LOCAL?span>SESSION的同义词?/p>

如果讄变量时不指定GLOBAL?span>SESSION或?span>LOCALQ默认?span>SESSION。参?a title="13.5.3. SET Syntax" href="mk:@MSITStore:D:%20wt%20book%20参考手?20MYSQL_50_%20中文手册.chm::/sql-syntax.html#set-option">13.5.3节,“SET语法”?/p>

要想索一?span>GLOBAL变量的|使用下面的语法:

mysql> SELECT @@global.sort_buffer_size;
mysql> SHOW GLOBAL VARIABLES like 'sort_buffer_size';

要想索一?span>SESSION变量的|使用下面的语法:

mysql> SELECT @@sort_buffer_size;
mysql> SELECT @@session.sort_buffer_size;
mysql> SHOW SESSION VARIABLES like 'sort_buffer_size';

q里Q?span>LOCAL也是SESSION的同义词?/p>

当你?span>SELECT @@var_name搜烦一个变量时(也就是说Q不指定global.?span>session.或?span>local.)Q?span>MySQLq回SESSION|如果存在Q,否则q回GLOBAL倹{?/p>

对于SHOW VARIABLESQ如果不指定GLOBAL?span>SESSION或?span>LOCALQ?span>MySQLq回SESSION倹{?/p>

当设|?span>GLOBAL变量需?span>GLOBAL关键字但索时不需要它们的原因是防止将来出现问题。如果我们移除一个与某个GLOBAL变量h相同名字?span>SESSION变量Q具?span>SUPER权限的客户可能会意外地更?span>GLOBAL变量而不是它自己的连接的SESSION变量。如果我们添加一个与某个GLOBAL变量h相同名字?span>SESSION变量Q想更改GLOBAL变量的客户可能会发现只有自己?span>SESSION变量被更改了?/p>

关于pȝ启动选项和系l变量的详细信息参见5.3.1节,“mysqld命o行选项”?a title="5.3.3. Server System Variables" href="mk:@MSITStore:D:%20wt%20book%20参考手?20MYSQL_50_%20中文手册.chm::/database-administration.html#server-system-variables">5.3.3节,“服务器系l变?#8221;。在5.3.3.1节,“动态系l变?#8221;中列Z可以在运行时讄的变量?/p>

 



]]>
mysql授权命ohttp://www.aygfsteel.com/willpower88/archive/2010/03/16/315590.html一?/dc:creator>一?/author>Tue, 16 Mar 2010 07:38:00 GMThttp://www.aygfsteel.com/willpower88/archive/2010/03/16/315590.htmlhttp://www.aygfsteel.com/willpower88/comments/315590.htmlhttp://www.aygfsteel.com/willpower88/archive/2010/03/16/315590.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/315590.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/315590.html
alter mysql.user 'root'@'%' identified by '123456';

mysql 5.x:
GRANT ALL PRIVILEGES ON *.* TO 'monitor'@'%' IDENTIFIED BY 'monitor' WITH GRANT OPTION;



]]>
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [work@tc-co-dev03.tc.baidu.com bin]$ http://www.aygfsteel.com/willpower88/archive/2010/01/08/308674.html一?/dc:creator>一?/author>Fri, 08 Jan 2010 03:12:00 GMThttp://www.aygfsteel.com/willpower88/archive/2010/01/08/308674.htmlhttp://www.aygfsteel.com/willpower88/comments/308674.htmlhttp://www.aygfsteel.com/willpower88/archive/2010/01/08/308674.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/308674.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/308674.html # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’;
mysql> FLUSH PRIVILEGES;
mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>
mysql>


]]>
linux下mysql启动http://www.aygfsteel.com/willpower88/archive/2009/08/05/289981.html一?/dc:creator>一?/author>Wed, 05 Aug 2009 10:29:00 GMThttp://www.aygfsteel.com/willpower88/archive/2009/08/05/289981.htmlhttp://www.aygfsteel.com/willpower88/comments/289981.htmlhttp://www.aygfsteel.com/willpower88/archive/2009/08/05/289981.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/289981.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/289981.html  cd mysql_path
find 
./ -name mysql.server
cd mysql
.server_path
mysql
.server start 
停止
mysql
.server stop



]]>
MySQL用户账号理http://www.aygfsteel.com/willpower88/archive/2009/08/05/289980.html一?/dc:creator>一?/author>Wed, 05 Aug 2009 10:21:00 GMThttp://www.aygfsteel.com/willpower88/archive/2009/08/05/289980.htmlhttp://www.aygfsteel.com/willpower88/comments/289980.htmlhttp://www.aygfsteel.com/willpower88/archive/2009/08/05/289980.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/289980.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/289980.html以rootq接到服务器上后Q可以添加新账户。下面的语句使用GRANT来设|四个新账户Q?/p>
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql>  GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
mysql> GRANT RELOAD,PROCESS ON *.* TO 'admin'@'localhost';
mysql> GRANT USAGE ON *.* TO 'dummy'@'localhost';

用GRANT语句创徏的̎h下面的属性:

·其中两个账户有相同的用户名monty和密码some_pass。两个̎户均U用戯̎Ph完全的权限可以做M事情。一个̎?('monty'@'localhost')只用于从本机q接时。另一个̎?'monty'@'%')可用于从其它Lq接。请注意monty的两个̎户必能从Q何主Zmontyq接。没有localhost账户Q当monty从本接时Q?strong>mysql_install_db创徏的localhost的匿名用戯̎户将占先。结果是Qmonty被视ؓ匿名用户。原因是匿名用户账户的Host列值比'monty'@'%'账户更具体,q样在user表排序顺序中排在前面?/p>

·一个̎h用户名adminQ没有密码。该账户只用于从本机q接。授予了RELOAD和PROCESS理权限。这些权限允许admin用户执行mysqladmin reload?strong>mysqladmin refresh?strong>mysqladmin flush-xxx命oQ以?strong>mysqladmin processlist。未授予讉K数据库的权限。你可以通过GRANT语句d此类权限?/p>

·一个̎h用户名dummyQ没有密码。该账户只用于从本机q接。未授予权限。通过GRANT语句中的USAGE权限Q你可以创徏账户而不授予M权限。它可以所有全局权限设ؓ'N'。假定你在以后具体权限授予该账户?/p>

1.     ?/span>MySQL删除用户账户

要想U除账户Q应使用DROP USER语句Q?/span>

DROP USER user [, user] ...

2.     限制账户资源

要想用GRANT语句讄资源限制QWITH子句来命名每个要限制的资源和Ҏ每小时记数的限制倹{例如,要想只以限制方式创徏可以讉Kcustomer数据库的新̎P执行该语句:

mysql> GRANT ALL ON customer.* TO 'francis'@'localhost'
    ->     IDENTIFIED BY 'frank'
    ->     WITH MAX_QUERIES_PER_HOUR 20
    ->          MAX_UPDATES_PER_HOUR 10
    ->          MAX_CONNECTIONS_PER_HOUR 5
    ->          MAX_USER_CONNECTIONS 2;
 

要想讄或更改已有̎L限制Q在全局U别使用GRANT USAGE语句(?.*)。下面的语句可以francis的查询限制更改ؓ100Q?/p>

mysql> GRANT USAGE ON *.* TO 'francis'@'localhost' WITH MAX_QUERIES_PER_HOUR 100;

该语句没有改变̎L已有权限Q只修改了指定的限制倹{?/p>

要想取消已有限制Q将该D|ؓ零。例如,要想取消francis每小时可以连接的ơ数的限Ӟ使用该语句:

mysql> GRANT USAGE ON *.* TO 'francis'@'localhost' WITH MAX_CONNECTIONS_PER_HOUR 0;

当̎户用资源时如果有非雉Ӟ则对资源使用q行记数?/p>

 

3.     讄账户密码

4.   可以?strong>mysqladmin命o在命令行指定密码Q?/span>

shell> mysqladmin -u user_name -h host_name password "newpwd"

该命令重讑֯码的账户为user表内匚wUser列的user_name和Host?em>你发赯接的客户端的记录?/span>

̎戯予密码的另一U方法是执行SET PASSWORD语句Q?/span>

mysql> SET PASSWORD FOR 'jeffrey'@'%' = PASSWORD('biscuit');

只有root{可以更新mysql数据库的用户可以更改其它用户的密码。如果你没有以匿名用戯接,省略FOR子句便可以更改自q密码Q?/span>

mysql> SET PASSWORD = PASSWORD('biscuit');

你还可以在全局U别使用GRANT USAGE语句(?.*)来指定某个̎L密码而不影响账户当前的权限:

mysql> GRANT USAGE ON *.* TO 'jeffrey'@'%' IDENTIFIED BY 'biscuit';

一般情况下最好用上q方法来指定密码Q你q可以直接修改user表:

·         要想在创建新账户时徏立密码,在Password列提供一个|

·                shell> mysql -u root mysql

·                mysql> INSERT INTO user (Host,User,Password) VALUES('%','jeffrey',PASSWORD('biscuit'));

·                mysql> FLUSH PRIVILEGES;

·                 

·         要想更改已有账户的密码,使用UPDATE来设|Password列|

·                shell> mysql -u root mysql

·                 mysql> UPDATE user SET Password = PASSWORD('bagel') WHERE Host = '%' AND User = 'francis';

·                mysql> FLUSH PRIVILEGES;

当你使用SET PASSWORD、INSERT或UPDATE指定账户的密码时Q必ȝPASSWORD()函数对它q行加密?唯一的特例是如果密码为空Q你不需要用PASSWORD())。需要用PASSWORD()是因为user表以加密方式保存密码Q而不是明文。如果你忘记了,你可能会象这栯|密码:

shell> mysql -u root mysql

mysql> INSERT INTO user (Host,User,Password) VALUES('%','jeffrey','biscuit');

mysql> FLUSH PRIVILEGES;

l果是密?biscuit'保存到user表后没有加密。当jeffrey使用该密码连接服务器ӞD加密q同保存在user表中的进行比较。但是,保存的gؓ字符?biscuit'Q因此比较将p|Q服务器拒绝q接Q?/span>

shell> mysql -u jeffrey -pbiscuit test

Access denied

如果你用GRANT ... IDENTIFIED BY语句?strong>mysqladmin password命o讄密码Q它们均会加密密码。在q种情况下,不需要?PASSWORD()函数?/span>

一?/a> 2009-08-05 18:21 发表评论
]]>
Access denied for user 'root'@'localhost'http://www.aygfsteel.com/willpower88/archive/2009/08/05/289977.html一?/dc:creator>一?/author>Wed, 05 Aug 2009 10:01:00 GMThttp://www.aygfsteel.com/willpower88/archive/2009/08/05/289977.htmlhttp://www.aygfsteel.com/willpower88/comments/289977.htmlhttp://www.aygfsteel.com/willpower88/archive/2009/08/05/289977.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/289977.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/289977.html # mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>


]]>
mysql 字符集查看及讄命ohttp://www.aygfsteel.com/willpower88/archive/2008/11/25/242523.html一?/dc:creator>一?/author>Tue, 25 Nov 2008 05:26:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/11/25/242523.htmlhttp://www.aygfsteel.com/willpower88/comments/242523.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/11/25/242523.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/242523.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/242523.html--查看数据库的字符?br /> show variables like 'character\_set\_%';
show variables like 
'collation_%';
--讄数据库字W编?br /> set names GBK
alter database payment character set GBK;
create database mydb character set GBK;
set character_set_client
=gbk;
set character_set_connection
=gbk;
set character_set_database
=gbk;
set character_set_results
=gbk;
set character_set_server
=gbk;
set character_set_system
=gbk;
set collation_connection
=gbk;
set collation_database
=gbk;
set collation_server
=gbk;

]]>
mysql latin1 javahttp://www.aygfsteel.com/willpower88/archive/2008/11/25/242480.html一?/dc:creator>一?/author>Tue, 25 Nov 2008 03:12:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/11/25/242480.htmlhttp://www.aygfsteel.com/willpower88/comments/242480.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/11/25/242480.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/242480.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/242480.html
Class.forName("org.gjt.mm.mysql.Driver");  
String url 
="jdbc:mysql://localhost/mysql";  
Connection conn
=DriverManager.getConnection(url,"root","root");  
  
Statement stmt
=conn.createStatement();  
String a
="老哈斯蒂?/span>";  
a
=new String(a.getBytes("GBK"),"iso8859-1");  
stmt.executeUpdate(
"insert into zquan (name) value ('"+a+"')");  
  
  
ResultSet rs
=stmt.executeQuery("select name from zquan");  
while(rs.next()){  
  String aaa
=rs.getString(1);  
  System.out.println(
new String(aaa.getBytes("iso8859-1"),"GB2312"));  




]]>
mysql decode()http://www.aygfsteel.com/willpower88/archive/2008/10/28/237186.html一?/dc:creator>一?/author>Tue, 28 Oct 2008 10:26:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/10/28/237186.htmlhttp://www.aygfsteel.com/willpower88/comments/237186.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/10/28/237186.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/237186.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/237186.html      oracleQ?br />
select decode(pay_name,'aaaa','bbb',pay_name),sum(comm_order),sum(suc_order),sum(suc_amount) From  payment.order_tab  group by decode(pay_name,'aaaaa','bbbb',pay_name)
转换成mysql:实现
 
select case when pay_name='aaa' then 'bbb' else pay_name end ,sum(comm_order),sum(suc_order),sum(suc_amount) From  payment.order_tab  group by case when pay_name='aaa' then 'bbb' else pay_name end 


     在mysql中有decode()是这栯释的Q一U是加密Q另外一U是比较
     在Oracle?
     语法QDECODE(control_value,value1,result1[,value2,result2…] [,default_result]);control _value试图处理的数倹{DECODE函数该数g后面的一pd的偶序相比较Q以军_q回倹{?br /> value1是一l成序偶的数倹{如果输入数g之匹配成功,则相应的l果被q回。对应一个空的返回|可以使用关键字NULL于之对应
result1 是一l成序偶的结果倹{?br /> default_result 未能与Q何一个值匹配时Q函数返回的默认倹{?br /> 例如Q?br /> selectdecode( x , 1 , ‘x is 1 ’, 2 , ‘x is 2 ’, ‘others’) from dual
当x{于1Ӟ则返?#8216;x is 1’?br /> 当x{于2Ӟ则返?#8216;x is 2’?br /> 否则Q返回others’?br /> 需要,比较2个值的时候,可以配合SIGN()函数一起用?br /> SELECT DECODE( SIGN(5 -6), 1 'Is Positive', -1, 'Is Nagative', 'Is Zero')
同样Q也可以用CASE实现Q?
SELECT CASE SIGN(5 - 6) 
WHEN 1 THEN 'Is Positive'
WHEN -1 THEN 'Is Nagative'
ELSE 'Is Zero' END
FROM DUAL

此外Q还可以在Order by中用Decode?br /> 例如Q表table_subjectQ有subject_name列。要求按照:语、数、外的顺序进行排序。这Ӟ可以非常轻杄使用Decode完成要求了?br /> select * from table_subject order by decode(subject_name, '语文', 1, '数学', 2, , '外语',3)Q责ȝ辑:卢兆林)






]]>
mysqlU程http://www.aygfsteel.com/willpower88/archive/2008/08/11/221328.html一?/dc:creator>一?/author>Mon, 11 Aug 2008 08:34:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/08/11/221328.htmlhttp://www.aygfsteel.com/willpower88/comments/221328.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/08/11/221328.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/221328.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/221328.html mysqladmin proc stat
mysqladmin proc stat -i 1 (间隔1s)
mysqladmin kill pid (kill掉死锁的U程的pid)

]]>
mysql导入导出http://www.aygfsteel.com/willpower88/archive/2008/08/07/220715.html一?/dc:creator>一?/author>Thu, 07 Aug 2008 08:54:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/08/07/220715.htmlhttp://www.aygfsteel.com/willpower88/comments/220715.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/08/07/220715.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/220715.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/220715.html    注:关于q问题Q在导入导出时可心加?-character-set=utf8/gbk

1、mysql导出?br />       /mysqldump -uroot -p -t dbName table -w "order_status=60 and date(init_time) >= '2008-05-01'and date(init_time) < '2008-07-11'" > dbName_table.txt 
mysql导出?br />    /mysqldump -u 用户?-p 数据库名 > 导出的文件名  

2、mysql导入

a ./mysql -uroot -p dbName < path/filename.sql

b. mysql>\. /path/filename.sql

mysqldump默认是lock-tables?如果是Innodb加上--single-transactionQ其它的存储引擎加上--skip-lock-tables备䆾的时候就不会锁表了?/strong>


]]>
Oracle EXTRACT()函数与to_char() 函数http://www.aygfsteel.com/willpower88/archive/2008/04/07/191278.html一?/dc:creator>一?/author>Mon, 07 Apr 2008 07:24:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/04/07/191278.htmlhttp://www.aygfsteel.com/willpower88/comments/191278.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/04/07/191278.html#Feedback1http://www.aygfsteel.com/willpower88/comments/commentRss/191278.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/191278.html
    摘自Q?a >http://www.cnblogs.com/ruanbl/archive/2008/02/29/1086398.html

EXTRACT extracts and returns the value of a specified datetime field from a datetime or interval value expression.
The field you are extracting must be a field of the datetime_value_expr or interval_value_expr. For example, you can extract only YEAR, MONTH, and DAY from a DATE value. Likewise, you can extract TIMEZONE_HOUR and TIMEZONE_MINUTE only from the TIMESTAMP WITH TIME ZONE datatype.
eg.

  • SELECT EXTRACT(YEAR FROM SYSDATE) FROM DUAL; return Current Year
  • SELECT EXTRACT(MONTH FROM SYSDATE) FROM DUAL; return Current Month
  • SELECT EXTRACT(DAY FROM SYSDATE) FROM DUAL; return Current Day
  • SELECT EXTRACT(HOUR FROM SYSDATE) FROM DUAL;Error
       Correct:SELECT EXTRACT(HOUR FROM TIMESTAMP '2005-10-10 10:10:10') FROM DUAL;
  • SELECT EXTRACT(MINUTE FROM SYSDATE) FROM DUAL;Error
       Correct:SELECT EXTRACT(MINUTE FROM TIMESTAMP '2005-10-10 10:10:10') FROM DUAL;

       以上是EXTRACT()函数的用说?英文部分有个很重要的部分.是extract 抽取q月日部分和时分部分的用方法是不同?
EXTRACT(YEAR FROM SYSDATE)中FROM 的下一个参数是日期cd的时候可以抽取年月日.是说这个参数是日期cd的时候就可以抽取q\月\?而抽取不了时\分部?抽取时分部分得在FROM 后面加带TIMESTAMP 且后面加旉字符.
   q里要注??MINUTE FROM TIMESTAMP '2005-10-10 10:10:10')?如果?2005-10-10 10:10:10'用日期类型的字段来代替ƈ转换成字W类型后,也是错误?估计是这Ҏ的问?
    比如(MINUTE FROM TIMESTAMP to_date(to_char(日期cd,'YYYY-MM-DD hh24:mi:ss'),'YYYY-MM-DD hh24:mi:ss')),q样执行不了?


    如果真要从日期类型的字段中抽取时\分部分用to_char() 函数可以了.比如to_char(日期cd,'hh24:mi') 




]]>
sqlserver触发oracle问题...http://www.aygfsteel.com/willpower88/archive/2008/02/28/182774.html一?/dc:creator>一?/author>Thu, 28 Feb 2008 11:46:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182774.htmlhttp://www.aygfsteel.com/willpower88/comments/182774.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182774.html#Feedback3http://www.aygfsteel.com/willpower88/comments/commentRss/182774.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/182774.html 触发器自动启用事务,q个事务的取消会造成整个语句执行的失?

在自q机器上试了一?我的环境?
WINDOWS SERVER2003 SP1 + SQLSERVER2000 SP4 + ACCESS2003
触发器很?只有一?
create trigger trg_update on testtb
for update
as
insert into openrowset('Microsoft.Jet.OLEDB.4.0', 'd:\test.mdb';'admin';'',table1)(id) select id from testtb
go

更新表testtb时报?
h的操作未能执行,因ؓ OLE DB 提供E序 'Microsoft.Jet.OLEDB.4.0' 不支持所需的事务接口?
OLE DB 错误跟踪QOLE/DB Provider 'Microsoft.Jet.OLEDB.4.0' IUnknown:ueryInterface returned 0x80004002Q?
-------------------------------------------------------------------------------------
如果在insert into openrowset(...)之前加上commit则成?例如:
alter trigger trg_update on testtb
for update
as
begin transaction /*启用嵌套事务*/
... /*嵌套事务内操?/
commit /*提交嵌套事务*/
commit /*提交触发器本w的隐性事?x外层事务)*/
insert into openrowset('Microsoft.Jet.OLEDB.4.0', 'd:\test.mdb';'admin';'',table1)(id) select id from testtb
go
q样做的实质是触发器中必LC地使用commit提交触发器本w的隐性事?~点是向ACCESS插入行的操作不在事务的控制范围内,如果? ACCESS插入行的操作p|,那么触发器中所有的操作均无法被回滚,因ؓcommit已经l束了触发器的事?操作已经被保存了.q样的触发器实际上只 是做C实时?却无法保证SQLSERVER与ACCESS之间的数据一致?



]]>
在Sql Server触发器中判断操作是Insertq是Updateq是Deletehttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182767.html一?/dc:creator>一?/author>Thu, 28 Feb 2008 10:26:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182767.htmlhttp://www.aygfsteel.com/willpower88/comments/182767.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182767.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/182767.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/182767.htmlDECLARE
    
@IsInsert bit,
    
@IsUpdate bit,
    
@IsDelete bit

IF EXISTS(SELECT 1 FROM inserted) AND NOT EXISTS(SELECT 1 FROM deleted)
    
SET @IsInsert = 1
ELSE
    
SET @IsInsert = 0

IF EXISTS(SELECT 1 FROM inserted) AND EXISTS(SELECT 1 FROM deleted)
    
SET @IsUpdate = 1
ELSE
    
SET @IsUpdate = 0

IF NOT EXISTS(SELECT 1 FROM inserted) AND EXISTS(SELECT 1 FROM deleted)
    
SET @IsDelete = 1
ELSE
    
SET @IsDelete = 0 
create   trigger   Update_Del   on   Table  
  
for   update,delete  
  
as  
  
if   not   exists(select   1   from   inserted)  
  
begin   /*inserted表无记录Q是删除*/  
  
end  
  
else    
  
begin   /*是更?/span>*/   end  
  
go 


]]>
SqlServer 链接 OracleCZhttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182726.html一?/dc:creator>一?/author>Thu, 28 Feb 2008 08:27:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182726.htmlhttp://www.aygfsteel.com/willpower88/comments/182726.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182726.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/182726.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/182726.htmlSET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO




ALTER     PROCEDURE proc_get_mt
AS
begin

    
declare cur_mt cursor for 
        
Select  * from OpenQuery(wxtl_test, 
                        
'select send_id,
                            mobile,
                            send_msg,
                              sys_id
                            from wxtlplatform.send 
                            where SEND_STATUS = 0
')
    
open cur_mt

    
declare     @v_send_id        varchar(20),
                
@v_mobile        varchar(21),
                
@v_send_msg        varchar(500),
                
@v_message        varchar(200),
                
@v_sys_id        varchar(20),
            
@v_cmd            varchar(500),
                
@v_ext_cmd        nvarchar(500),
                
@v_ext_code        varchar(20),
                
@v_OrgAddr        varchar(100)

    
fetch next from cur_mt into @v_send_id,@v_mobile,@v_send_msg,@v_sys_id
    
while @@fetch_status = 0
        
begin
            
PRINT ' '
           
SELECT @v_message = '----- Send info : ' + @v_send_id + ' ' + @v_mobile + ' ' + @v_send_msg
           
PRINT @v_message
            
            
--查找扩展?nbsp;           
            select @v_ext_cmd = 'Select @v_ext_code=down_lt from OpenQuery(wxtl_test,''select down_lt from wxtlplatform.sys_info where sys_id = ' + 
                         
@v_sys_id + ''')'
            
            
exec sp_executesql @v_ext_cmd, N'@v_ext_code varchar(20) output'@v_ext_code output
            
Select @v_ext_code
            
PRINT @v_ext_code 
            
PRINT @v_ext_cmd
            
select @v_OrgAddr = '62090001001' + @v_ext_code
            
--exec proc_get_mt

            
--插入MAS MT?/span>
            INSERT INTO tbl_SMSendTask
              (CreatorID,
               TaskName,
               SmSendedNum,
               OperationType,
               SuboperationType,
               SendType,
               OrgAddr,
               DestAddr,
               SM_Content,
               SendTime,
               NeedStateReport,
               ServiceID,
               FeeType,
               FeeCode,
               MsgID,
               SMType,
               MessageID,
               DestAddrType,
               SubTime,
               TaskStatus,
               SendLevel,
               SendState,
               TryTimes,
               
Count,
               SuccessID,
               Reserve1,
               Reserve2)
            
VALUES(
               
'0000'
                
''
                
0
                
'WAS'
                
'66'
                
1
                
@v_OrgAddr
                
@v_mobile
                
@v_send_msg
                
GETDATE(), 
                
1
                
'EIE'
                
'01'
                
'0'
                
''
                
0
                
'0'
                
0
                
GETDATE(), 
                
0
                
0
                
3
                
0
                
0
                
0
                
''
                
'')

--'0404','',0,'WAS','66',1,'620900010010404','13800138000',convert(varchar(100),getdate(),121),getdate(),
--
1,'EIE','01','0','',0,'0',0,getdate(),0,0,0,0,0,0)


            
--修改华夏基金MT?/span>
            select @v_cmd = 'update OpenQuery(wxtl_test, ''select SEND_STATUS from wxtlplatform.send where send_id = ' + 
                         
@v_send_id + ''') set SEND_STATUS=2'


            
PRINT @v_cmd
            
--exec(@v_cmd)

            
--游标Ud
            fetch next from cur_mt into @v_send_id,@v_mobile,@v_send_msg,@v_sys_id
        
end
    
close cur_mt
    
deallocate cur_mt
end



GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO



]]>
OpenQuery 函数对远E表执行 UPDATE?INSERT, ?DELETETCZhttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182618.html一?/dc:creator>一?/author>Thu, 28 Feb 2008 02:54:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182618.htmlhttp://www.aygfsteel.com/willpower88/comments/182618.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/02/28/182618.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/182618.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/182618.html
update openquery(linked1, 'select ssn from testlinked where ssn=2')
set ssn=ssn + 1
insert openquery(linked1, 'select ssn from testlinked where 1=0'values (1000)
delete openquery(linked1, 'select ssn from testlinked where ssn>100')

2、?OpenQuery 动态执?/pre>

begin tran
SET QUOTED_IDENTIFIER OFF
SET XACT_ABORT ON
declare @cmd varchar(2500
declare @cmd1 varchar(2500
declare @var varchar(20
set @var = 'White' 
declare @var1 varchar(20
set @var1 = 'White1' 
declare @var2 varchar(20
set @var2 = 'Johnson1'

select @cmd = "Update openquery(linked1,'select au_lname, au_fname from pubs.dbo.authors
where au_lname = 
''" + @var + "''' )
set au_lname = '" + @var1 + "',
au_fname 
= '" + @var2 + "'"

exec ( @cmd )

commit tran
select * from <servername>.pubs.dbo.authors



]]>Mysql数据库和Linuxpȝ常用命o http://www.aygfsteel.com/willpower88/archive/2008/02/27/182402.html一?/dc:creator>一?/author>Wed, 27 Feb 2008 02:15:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/02/27/182402.htmlhttp://www.aygfsteel.com/willpower88/comments/182402.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/02/27/182402.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/182402.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/182402.html1:使用SHOW语句扑և在服务器上当前存在什么数据库Q?br />   mysql> SHOW DATABASES;
2:创徏一个数据库MYSQLDATA
  mysql> CREATE DATABASE MYSQLDATA;
3:选择你所创徏的数据库
  mysql> USE MYSQLDATA; (按回车键出现Database changed 时说明操作成功!)
4:查看现在的数据库中存在什么表
  mysql> SHOW TABLES;
5:创徏一个数据库?br />   mysql> CREATE TABLE MYTABLE (name VARCHAR(20), sex CHAR(1));
6:昄表的l构Q?br />   mysql> DESCRIBE MYTABLE;
7:往表中加入记录
  mysql> insert into MYTABLE values ("hyq","M");
8:用文本方式将数据装入数据库表中(例如D:/mysql.txtQ?br />   mysql> LOAD DATA LOCAL INFILE "D:/mysql.txt" INTO TABLE MYTABLE;
9:导入.sql文g命oQ例如D:/mysql.sqlQ?br />   mysql> use database;
  mysql> source d:/mysql.sql;
10:删除?br />   mysql> drop TABLE MYTABLE;
11:清空?br />   mysql> delete from MYTABLE;
12:更新表中数据
  mysql> update MYTABLE set sex="f" where name=hyq;



此外QLinux下经怋用的命oQ?br />
 

1:导入数据库备份文件的ҎQ?br />   root: mysql –u数据库帐?–p密码 数据库名 < .sql备䆾文g
2:MySql的用L理是通过User表来实现的,d新用户常用的Ҏ有两个,一是在User表插入相应的数据行,同时讄相应的权限;二是通过GRANT命o创徏h某种权限的用戗其中GRANT的常用用法如下:
  mysql> grant all privileges on 数据库名.* to 用户名@localhost identified by “密码”;
3:清空文g内容Q?br />   cat /dev/null > 文g?br /> 4:d帐户Q?br />   useradd 用户?–d 目录?–s /sbin/nologinQ不允许该用L接登录服务器Q?br /> 5:讄帐户密码
  passwd 用户?/div>



特别注意Q?/strong>
刚安装好的MySql包含一个含I密码的root帐户和一个匿名帐Pq是很大的安全隐患,对于一些重要的应用我们应将安全性尽可能提高Q在q里应把匿名帐户删除?root帐户讄密码Q可用如下命令进行:
use mysql;
delete from User where User="";
update User set Password=PASSWORD(newpassword) where User=root;

 

引用
作? 郝聪
原蝲: 黑色梦中SEO博客
版权所?转蝲时请注明作者ƈ以链接Ş式标注原始出?


]]>ORACLE10g加ؓSQL Server 2000的链接服务器http://www.aygfsteel.com/willpower88/archive/2008/02/19/180730.html一?/dc:creator>一?/author>Tue, 19 Feb 2008 09:54:00 GMThttp://www.aygfsteel.com/willpower88/archive/2008/02/19/180730.htmlhttp://www.aygfsteel.com/willpower88/comments/180730.htmlhttp://www.aygfsteel.com/willpower88/archive/2008/02/19/180730.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/180730.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/180730.html引用Q?a >http://epub.itpub.net/4/8.htm

有两U方法:Q推荐用第二种Q?br />

1、在查询分析器中执行sp_addlinkedserver

   USE master

   GO

   EXEC sp_addlinkedserver

      @server = 'xzh.world',       --ORACLE链接服务器的名称

      @srvproduct = 'Oracle',      --固定不变?/span>

      @provider = 'MSDAORA',       --固定不变?/span>

      @datasrc = 'xzh.world'       --Net8中的服务器别名(|络服务名)

 

2、在企业理器中

 

   1)在sql server2000 的企业管理器里面, 扑ֈ安全?>链接服务?>新徏
2)在新建对话框"常规"选项卡里? 选择Microsoft ole db provider for oracle驱动. 产品名称固定填ؓ"Oracle", 数据源就是上面徏立的|络名称ora. 提供E序字符串填?"MSDAORA".
3)在新建对话框"安全? 选项卡里? 选择" 用此安全上下文进?", 输入oracle9i serverZ分配的用户名和密?
4)?常规"选项卡里面输入你链接服务器取的名U?/p>

3、如何引?/span>ORACLE链接服务器中的数?/span>

  

Select  top 10 * from OpenQuery(linkname, 'Select * from user.tablename')

 

(END)





]]>
PLS-00103: 出现W号 ","在需要下列之一?/title><link>http://www.aygfsteel.com/willpower88/archive/2007/12/03/165007.html</link><dc:creator>一?/dc:creator><author>一?/author><pubDate>Mon, 03 Dec 2007 13:07:00 GMT</pubDate><guid>http://www.aygfsteel.com/willpower88/archive/2007/12/03/165007.html</guid><wfw:comment>http://www.aygfsteel.com/willpower88/comments/165007.html</wfw:comment><comments>http://www.aygfsteel.com/willpower88/archive/2007/12/03/165007.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/willpower88/comments/commentRss/165007.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/willpower88/services/trackbacks/165007.html</trackback:ping><description><![CDATA[存储q程ZQ(<span style="color: red;">注:我用的是oracle 10g</span>)<br />   <div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #0000ff;">procedure</span><span style="color: #000000;"> aaaa(i_vc2mob      </span><span style="color: #808080;">in</span><span style="color: #000000;"> </span><span style="color: #000000; font-weight: bold;">varchar2</span><span style="color: #000000;">, </span><span style="color: #008080;">--</span><span style="color: #008080;">用户L</span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         i_NUMSVCID    </span><span style="color: #808080;">in</span><span style="color: #000000;"> PLS_INTEGER </span><span style="color: #0000ff;">default</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;">, </span><span style="color: #008080;">--</span><span style="color: #008080;">SERVICECODEID</span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         i_prodid      </span><span style="color: #808080;">in</span><span style="color: #000000;"> PLS_INTEGER </span><span style="color: #0000ff;">default</span><span style="color: #000000;"> </span><span style="color: #0000ff;">null</span><span style="color: #000000;">, </span><span style="color: #008080;">--</span><span style="color: #008080;">产品ID</span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         i_disordsrc   </span><span style="color: #808080;">in</span><span style="color: #000000;"> PLS_INTEGER, </span><span style="color: #008080;">--</span><span style="color: #008080;">退定来?/span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         i_disordsrcid </span><span style="color: #808080;">in</span><span style="color: #000000;"> </span><span style="color: #000000; font-weight: bold;">NUMBER</span><span style="color: #000000;">, </span><span style="color: #008080;">--</span><span style="color: #008080;">退定来源ID</span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         i_datdisorder </span><span style="color: #808080;">in</span><span style="color: #000000;"> date </span><span style="color: #0000ff;">default</span><span style="color: #000000;"> sysdate, </span><span style="color: #008080;">--</span><span style="color: #008080;">退定时?/span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         o_prodid      out PLS_INTEGER, </span><span style="color: #008080;">--</span><span style="color: #008080;">q回产品ID </span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         o_level       out PLS_INTEGER, </span><span style="color: #008080;">--</span><span style="color: #008080;">q回用户U别</span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         o_flag        out PLS_INTEGER </span><span style="color: #008080;">--</span><span style="color: #008080;">q回状?/span><span style="color: #008080;"><br /> </span><span style="color: #000000;">                         ) </span><span style="color: #0000ff;">is<br /> <br /> </span></div> <br /> <br /> 在java中调用正调用方法:<br /> {<span style="color: #2e10ff;">call aaaa('13472622059',1,1,21,4712032059528901,'',?,?,?)</span>}<br /> <br /> 如果q样?br /> {<span style="color: #ff0000;">call aaaa('13472622059',1,1,21,4712032059528901,,?,?,?)</span>}<br /> 报如下异常Q?br /> java.sql.SQLException: ORA-06550: W?1 ? W?67 ? <br /> PLS-00103: 出现W号 ","在需要下列之一Ӟ<br />  ( - + case mod new not null<br />    others <an identifier> <a double-quoted delimited-identifier><br />    <a bind variable> avg count current exists max min prior sql<br />    stddev sum variance execute forall merge time timestamp<br />    interval date<br />    <a string literal with character set specification><br />    <a number> <a single-quoted SQL string> pipe<br />    <一个带有字W集说明的可带引L字符串文?gt;<br />    <一个可带引L SQL 字符?gt;<br /> W号 "null" 被替换ؓ "," 后l?br /> <br />     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)<br />     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)<br />     at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)<br />     at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)<br />     at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:215)<br />     at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:954)<br />     at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1168)<br />     at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)<br />     at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)<br />     at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)<br />     at com.pub.comm.db.DBDeal.callProcedures2(DBDeal.java:36)<br />     at com.pub.comm.db.Test.<init>(Test.java:15)<br />     at com.pub.comm.db.Test.main(Test.java:29)<br /> <br /> <img src ="http://www.aygfsteel.com/willpower88/aggbug/165007.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/willpower88/" target="_blank">一?/a> 2007-12-03 21:07 <a href="http://www.aygfsteel.com/willpower88/archive/2007/12/03/165007.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle JOB创徏http://www.aygfsteel.com/willpower88/archive/2007/10/22/154890.html一?/dc:creator>一?/author>Mon, 22 Oct 2007 02:35:00 GMThttp://www.aygfsteel.com/willpower88/archive/2007/10/22/154890.htmlhttp://www.aygfsteel.com/willpower88/comments/154890.htmlhttp://www.aygfsteel.com/willpower88/archive/2007/10/22/154890.html#Feedback0http://www.aygfsteel.com/willpower88/comments/commentRss/154890.htmlhttp://www.aygfsteel.com/willpower88/services/trackbacks/154890.html begin
  sys.dbms_job.submit(job => :job,
                      what => 'Cancel_36_37;',
                      next_date => to_date('22-10-2007 11:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'trunc(sysdate +1/24,''hh'')');
  commit;
end;
/


]]>
վ֩ģ壺 ֬| ˳| ̨| | | | ¡| ͨ| | | | ʯ| | °Ͷ| | | | | Զ| ̨| | Ϫ| ˹| | ζ| | ϼ| | Ѱ| ʡ| կ| | | | | | ͷ| ԫ| ɽ| | ʡ|