文档介绍:mysql 学****启动关闭服务 mysqld --console mysqladmin -u root shutdown 修改密码: mysqladmin -u root password "newpass" SHOW VARIABLES LIKE 'character%'; SHOW VARIABLES LIKE 'collation_%'; show engines; show databases; mysql> GRANT ALL PRIVILEGES ON *.* TO 'guming'@'localhost' IDENTIFIED BY 'gumin g' WITH GRANT OPTION; show PRIVILEGES; 查看权限 show grants for ******@localhost; 查看用户权限 select * from where user='root'; 函数逻辑:case when,isnull,IFnull 等数学:mod,cell,floor,round(),trancate(),abs() 字符串: rtrim,ltrim,substring,locate(),INSTR(),length,left,right * REPEAT(str,count) 返回一个由重复的字符串 str 组成的字符串,字符串 str 的数目等于 count 。若 count <= 0, 则返回一个空字符串。若 str 或 count 为 NULL ,则返回 NULL 。 mysql> SELECT REPEAT('MySQL', 3); -> 'MySQLMySQLMySQL' * REPLACE(str,from_str,to_str) 返回字符串 str 以及所有被字符串 to_st r 替代的字符串 from_str 。 mysql> SELECT REPLACE('', 'w', 'Ww'); -> '.com' 这个函数支持多字节字元。* REVERSE(str) 返回字符串 str ,顺序和字符顺序相反。 mysql> SELECT REVERSE('abc'); -> 'cba' 这个函数支持多字节字元。日期: current_date,datediff,adddate,date_add,dayofweek,dayofyear, dayofmonth,month,hour(), str_to_date: SELECT STR_TO_DATE('20031031',GET_FORMAT(DATE,'ISO')); select date_format(current_date(),'%Y-%m-%d %W'); select extract(YEAR_MONTH FROM current_date()); 转换: cast: 可使用 CAST() 函数将某个值转为另外一种类型。 CONVERT convert_TZ:CONVERT_TZ() 将时间日期值 dt从 from_tz 给出的时区转到 to_tz 给出的时区 concat: 返回结果为连接参数产生的字符串。如有任何一个参数为 NULL ,则返回值为 NULL 。全文检索 SELECT * FROM articles WH