MySQLÊý¾Ý¿âµÄdb.optÎļþ
MySQLµÄÿ¸öÊý¾Ý¿âĿ¼ÖÐÓÐÒ»¸öÎļþdb.opt,¸ÃÎļþÖ÷Òª ÓÃÀ´´æ´¢µ±Ç°Êý¾Ý¿âµÄĬÈÏ×Ö·û¼¯ºÍ×Ö·ûУÑé¹æÔò¡£
eg.default-character-set=latin1
default-collation=latin1_swedish_ci
¸ÃÎļþÖд洢µÄÊÇ´´½¨Êý¾Ý¿âʱĬÈϵÄ×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£¬Ôò¸ÃÊý¾Ý¿âÔÚÒÔºó´´½¨±íʱÈç¹ûûÓÐÖ¸¶¨×Ö·û¼¯ºÍУÑé¹æÔò£¬Ôò¸Ã±íµÄÕâÁ½¸öÊôÐÔ½«È¥×ÔÕâÁ½¸ö±í¡£
MySQLÔ´Â룺
/* Set table default charset, if not set
SYNOPSIS
set_table_default_charset()
create_info Table create information
DESCRIPTION
If the table character set was not given explicitely,
let’s fetch the database default character set and
apply it to the table. */
static void set_table_default_charset(THD *thd,
HA_CREATE_INFO *create_info, char *db)
{
if (!create_info->default_table_charset)
{
HA_CREATE_INFO db_info;
load_db_opt_by_name(thd, db, &db_info);
create_info->default_table_charset= db_info.default_table_charset;
}
´´½¨Êý¾Ý¿âʱָ¶¨×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£º
create database if not exists test default [charset|character set ] utf8
default collate utf8_general_ci;
ÐÞ¸ÄÊý¾Ý¿âµÄ×Ö·û¼¯ºÍ×Ö·û¼¯Ð£Ñé¹æÔò£º
alter database test default [charset|character set ] latin1 default collate
latin1_swedish_ci;
´´½¨Êý¾Ý¿âcreate database
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[create_specification] …
create_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
Ò²¿ÉÒÔͨ¹ýalter databaseÐÞ¸Ä
ALTER {DATABASE | SCHEMA} [db_name]
alter_specification …
alter_specification:
[DEFAULT] CHARACTER SET [=] charset_name
| [DEFAULT] COLLATE [=] collation_name
±¾ÎÄÀ´×Ô£ºhttp://yubowei.blog.51cto.com/978243/282975
Ïà¹ØÎĵµ£º
±àÒëÁËÒ»¸öwindowsϵÄpython3Á¬½ÓMysqlµÄ¿â
mypysql
°æ±¾ÊÇ 0.5.1 £¬¸ù¾Ý¹Ù·½µÄÐÞ¸ÄÈÕÖ¾£¬Õâ¸ö°æ±¾ÐÞ¸ÄÁË0.5ÖÐÒ»¸öÄÚ´æй©ÎÊÌâ¡£
Ô´´úÂëºÍ±àÒëºóµÄÎļþΪ£º
http://211.147.215.55/down/mypysql-0.5.1-win.zip
mypysqlµÄ¹Ù·½µØÖ· https://sourceforge.net/projects/mypysql/
......
·ÀÖ¹×¢ÈëµÄ¼¸ÖÖ°ì·¨
ÆäʵÔÀ´¾ÍÊÇÎÒÃÇÐèÒª¹ýÂËһЩÎÒÃdz£¼ûµÄ¹Ø¼ü×ֺͷûºÏÈ磺
Select£¬insert£¬update£¬delete£¬and£¬*£¬µÈµÈ
function inject_check($sql_str) {
return eregi('select|insert|update|delete|\'|\/\*|\*|\.\.\/|\.\/|union|into|load_file
|outfile', $sql_str); & ......
1¡¢´´½¨mysqlÊý¾Ý¿âµÄ¹ÜÀíÓû§
Êý¾Ý¿â°²×°ºÃºó£¬ÎÒÃÇÓ¦¸ÃΪmysqlÊý¾Ý¿â´´½¨Ò»¸ö¹ÜÀíÕʺš£Òª°ÑrootÓû§ÉèÖÃΪ¹ÜÀíÔ±£¬´ËʱÐèÒªÖ´ÐÐÏÂÃæÃüÁ
[root@CDS2 bin]# /usr/bin/mysqladmin -u root password 123456
˵Ã÷£ºÉÏÃæ´´½¨µÄmysqlÊý¾Ý¿â¹ÜÀíԱΪroot£¬ÃÜÂë123456
2¡¢´´½¨Ò»°ãµÄÓû§
¹¤×÷ÖÐÓõ½web·þÎñÆ÷ºÍmysql·þÎñÆ ......
MysqlÔÚĬÈÏÇé¿öϽ¨Á¢±íµÄ×Ö·û±àÂëÊÇlatin1£¬ËùÒÔÔÚ²åÈëÖÐÎÄʱ»á³ö´í¡£
eg£º
1¡¢²é¿´±í½¨Á¢µÄsqlÔ´Â룺
1: sqlÃüÁshow create table users
2:
3: ½á¹û£º
4: CREATE TABLE `users` (
5: `userID` int(10) unsigned NOT NULL AUTO_INCREMENT,
6: `userName` varchar(4 ......
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test &n ......