FedoraÏÂMysqlµÄ¼òµ¥Ê¹ÓÃ
תµ½¸½Â¼1£¨mysql ÃüÁî´óÈ« - ÃüÁîÏê½â
£©
תµ½¸½Â¼2£¨mysqlÂÒÂëÎÊÌâ½â¾ö·½·¨
£©
ÔÚÎÒµÄFedoraÖУ¬ÔÚϵͳ°²×°Ê±ÎÒ¾ÍÑ¡Ôñ°²×°ÁËMysqlÁË£¬ËùÒԾͲ»ÓÃÔÙÈ¥ÏÂÔØÔ´´úÂ룬ȻºóÈ¥ÂýÂý±àÒë¡£¹þ¹þ£¬ÍµÁËÒ»¸öÀÁ¡£
ϵͳ°²×°ºÃÁË£¬Mysqlʱ±Ø²»¿ÉÉٵģ¬ËùÒÔÒ»¶¨Òª¼ìÑéÒ»ÏÂMysql¿ÉÒÔÓò»¡£
Ê×ÏÈÇл»µ½rootÕË»§£¬È»ºóÊäÈëÃüÁservice mysqld start
ϵͳÏÔʾÈçÏ£º
³õʼ»¯ MySQL Êý¾Ý¿â£º Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h stony password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script! [È·¶¨]
ÕýÔÚÆô¶¯ mysqld£º [È·¶¨]
¿´À´MysqlµÄ·þÎñ¿ÉÒÔÆô¶¯ÆðÀ´£¬Ó¦¸ÃÎÊÌâ²»´óÁË¡£
ÂíÉÏÌí¼ÓrootÃÜÂ룬mysqladmin -u root password xxxxxx
µÇ¼ÒÔÏ£¬ÊäÈëÃüÁmysql -u root -p
ÇëÇóÊäÈëÃÜÂ룬ÊäÈëÃÜÂ룬½øÈëÁË£¡^_^
µ½ÕâÀӦ¸Ã»ù±¾ÉÏ¿ÉÒÔ˵MysqlÊÇûÓÐÎÊÌâµÄÁË¡£Ê±¼ä²»ÔçÁË£¬½ñÌìµÄMysql¾ÍŪµ½ÕâÀï¡£Ã÷Ì쿪ʼ
Ïà¹ØÎĵµ£º
¾¡¿ÉÄܵØʹÓÃ×îÓÐЧ(×îС)µÄÀàÐÍ¡£MySQLÓкܶà½ÚÊ¡´ÅÅÌ¿Õ¼äºÍÄÚ´æµÄרҵ»¯ÀàÐÍ¡£
Èç¹û¿ÉÄÜʹ±í¸üС£¬Ê¹ÓýÏСµÄÕûÊýÀàÐÍ¡£ÀýÈ磬MEDIUMINT¾³£±ÈINTºÃһЩ¡£
Èç¹û¿ÉÄÜ£¬ÉùÃ÷ÁÐΪNOT NULL¡£ËüʹÈκÎÊÂÇé¸ü¿ì¶øÇÒÄãΪÿÁнÚʡһλ¡£×¢ÒâÈç¹ûÔÚÄãµÄÓ¦ÓóÌÐòÖÐÄãȷʵÐèÒªNULL£¬ÄãÓ¦¸ÃºÁÎÞÒÉÎÊʹÓÃËü£¬Ö»ÊDZÜÃâȱʡµØÔÚËùÓ ......
дÈëʱ£¬ÏÈ×öencode£º
public static String encode(String src) {
String result = null;
try {
result = new String(src.getBytes("gbk"), "ISO-8859-1");
} catch (UnsupportedEncodingException uee) {
System.err.println(uee);
}
return result;
}
¶Á³öʱ£¬ÔÙ×ödecode£º
public static String deco ......
mysqlµÄ find_in_setº¯ÊýʹÓ÷½·¨
ºÜ¶àʱºòÎÒÃÇÔÚÉè¼ÆÊý¾Ý¿âʱÓÐÕâÖÖÇé¿ö,±ÈÈç:
ÓиöÎÄÕ±íÀïÃæÓиötype×Ö¶Î,Ëû´æ´¢µÄÊÇÎÄÕÂÀàÐÍ,ÓÐ 1Í·Ìõ,2ÍƼö,3Èȵã,4ͼÎÄ .....11,12,13µÈµÈ
ÏÖÔÚÓÐƪÎÄÕÂËû¼ÈÊÇ Í·Ìõ,ÓÖÊÇÈȵã,»¹ÊÇͼÎÄ,
typeÖÐÒÔ 1,3,4µÄ¸ñʽ´æ´¢.
ÄÇÃÇÎÒÃÇÈçºÎÓÃsql²éÕÒËùÓÐtypeÖÐÓÐ4ͼÎıê×¼µÄÎÄÕÂÄØ ......
×òÌìÒªmysqlÖÐд´æ´¢¹ý³Ì·¢ÏÖÍøÉÏÓйØÓÚcursorÑ»·ÇÒÌ×µÄ×ÊÁϺÜÉÙ,ÏÖ·¢³ö±¾ÈËдµÄÀý×Ó,Ï£ÍûÄܶԴó¼ÒÓаïÖú.
¿´ÕÐ:
DELIMITER $$
USE `ad_db`$$
DROP PROCEDURE IF EXISTS `test`$$
CREATE DEFINER=`root`@`%` PROCEDURE `test`()
BEGIN
/** CPAЧ¹ûÊý */
DECLARE _tmpId1 INT;
DECLARE ......
select `a`.`id` AS `id`,`a`.`UserName` AS `UserName`,
(case when (`a`.`sRegDate` = _utf8'1990-01-01 00:00:00.0') then _utf8'' else cast(date_format(`a`.`sRegDate`,_utf8'%Y-%m-%d %H:%i:%S') as char charset utf8) end) AS `sRegDate`,(case when (`a`.`feeendtime` = _utf8'1990-01-01 00:00:00.0') then _ut ......