首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

MySQL汉字字段按拼音排序跟备份

2012-08-25 
MySQL汉字字段按拼音排序和备份UTF-8编码的数据库,如果希望汉字字段按照拼音排序:SELECT * FROM students

MySQL汉字字段按拼音排序和备份

UTF-8编码的数据库,如果希望汉字字段按照拼音排序:

SELECT * FROM students ORDER BY CONVERT( name USING gbk ) ;

?原文地址:http://blog.csdn.net/stephenxu111/archive/2009/08/11/4436181.aspx

?

?

数据库备份:

?

#mysqldump最常用于备份一个整个的数据库:shell> mysqldump -u username -p --opt db_name > backup-file.sql#你可以这样将转储文件读回到服务器:shell> mysql -u username -p db_name < backup-file.sql
?创建用户:
CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
??为用户分配访问权限:
GRANT ALL ON database_name.* TO 'username'@'localhost';
?查看用户权限:
show grants;show grants for username;show grants for username@localhost;
?修改用户密码:
set password for username@’localhost’ = password(‘newpassword’); flush privileges;

取消用户授权:
revoke all on *.* from sss@localhost ;
?删除用户:
use mysqldelete from user where user='name' and host='localhost' ;flush privileges ;
?

热点排行