// 启动服务 mysqld --console
// 停止服务 mysqladmin -u root shutdown
// 登录后使用数据库 mysql mysql -u root -p mysql mysql -u root -p -h 11.11.11.11 database
// 创建数据库 create database db_name [default character set=gbk]
// 设置数据库默认字符集 alter databse db_name default character set gbk
// 更换数据库 use database test after log on use test
// 创建一个带图像字段的表 create a table mypic to store picture create table mypic (picid int, picname varchar(20), content blob);
// 显示表的结构 describe table mypic desc mypic
// 显示当前表的建表语句 show create table table_name
// 更改表类型 alter table table_name engine innodb|myisam|memory
// 插入一条记录 insert a record insert into mypic values (1, '第二章', 0x2134545);
// 显示当前用户 show current user select user();
// 显示当前用户密码 show current password select password('root');
// 显示当前日期 show current date select now();
// 更改用户密码 change user password update user set password=password('xxx') where user='root';
// 分配用户权限 grant grant all privileges on *.* to root@localhost grant select,insert,delete,update,alter,create,drop on lybbs.* to lybbs@"%" identified by "lybbs"; grant select,insert,delete,update,alter,create,drop on lybbs.* to lybbs@localhost identified by "lybbs";
// 在不重启的情况下刷新用户权限 flush privileges flush privileges
// 向表中增加一个主键 add primary key alter table mypic add primary key (picid)
// 修改表结构增加一个新的字段 add a new column userid after picid alter table mypic add column userid int after picid
// 更改列类型,当存储图像过大时,使用默认blob超不过100k alter table userpic change image image longblob; alter table userpic modify image longblob;
// 设置默认字符集为gb2312 mysqld --default-character-set=gb2312
// 显示详细信息,包括字符集编码 show full columns from userpic;
// 改变表的编码 ALTER TABLE userpic CHARACTER SET gb2312;
// mysql jdbc连接url 使用中文 jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=gb2312
// 执行外部脚本 source <filename>
MySQL是最受欢迎的开源SQL数据库管理系统,由MySQL AB开发、发布和支持。MySQL AB是一家基于MySQL开发人员的商业公司,是一家使用了一种成功的商业模式来结合开源价值和方法论的第二代开源公司。MySQL是MySQL AB的注册商标。
MySQL是一个快速的、多线程、多用户和健壮的SQL数据库服务器。MySQL服务器支持关键任务、重负载生产系统的使用,也可以将它嵌入到一个大配置(mass-deployed)的软件中去。 [MySql]PHP存取 Mysql 数据乱码终极解决方案 [MySql]解决Table xxx is marked as crashed and should … [MySql][MySQL]快速解决"is marked as crashed and shoul… [MySql]MySQL DELETE语法用法详解 [MySql]mysql中时间日期格式化 [Web开发]帝国cms内容页上一篇和下一篇调用方法大全 [MySql]修改mysql导入文件大小限制 [聊天工具]MSN群功能使用帮助及MSN快捷键大全 [互联动态]Godaddy域名注册及空间服务器2010优惠码大全 [电脑技术]windows7快捷键使用大全
|