易截截图软件、单文件、免安装、纯绿色、仅160KB

MySql常用命令

  启动:net start mySql;
  进入:mysql -u root -p/mysql -h localhost -u root -p databaseName;
  列出数据库:show databases;
  选择数据库:use databaseName;
  列出表格:show tables;
  显示表格列的属性:show columns from tableName;
  建立数据库:source fileName.txt;
  匹配字符:可以用通配符_代表任何一个字符,%代表任何字符串;
  增加一个字段:alter table tabelName add column fieldName dateType;
  增加多个字段:alter table tabelName add column fieldName1 dateType,add columns fieldName2 dateType;
  多行命令输入:注意不能将单词断开;当插入或更改数据时,不能将字段的字符串展开到多行里,否则硬回车将被储存到数据中;
  增加一个管理员帐户:grant all on *.* to user@localhost identified by "password";
  每条语句输入完毕后要在末尾填加分号';',或者填加'\g'也可以;
  查询时间:select now();
  查询当前用户:select user();
  查询数据库版本:select version();
  查询当前使用的数据库:select database();
 
  1、删除student_course数据库中的students数据表:
  rm -f student_course/students.*
 
  2、备份数据库:(将数据库test备份)
  mysqldump -u root -p test>c:\test.txt
  备份表格:(备份test数据库下的mytable表格)
  mysqldump -u root -p test mytable>c:\test.txt
  将备份数据导入到数据库:(导回test数据库)
  mysql -u root -p test
 
  3、创建临时表:(建立临时表zengchao)
  create temporary table zengchao(name varchar(10));
 
  4、创建表是先判断表是否存在
  create table if not exists students(……);
 
  5、从已经有的表中复制表的结构
  create table table2 select * from table1 where 1<>1;
 
  6、复制表
  create table table2 select * from table1;
 
  7、对表重新命名
  alter table table1 rename as table2;
 
  8、修改列的类型
  alter table table1 modify id int unsigned;//修改列id的类型为int unsigned
  alt


相关文档:

关于MySQL的1067错误解决方法

 ※ 关于MySQL的1067错误解决方法 ※
内容:
*************
1
安装MYSQL后更改了ROOT的密码后用
net startmysql
启动时我就遇到了这样的问题.使用以下命令后
c:\mysql\bin\mysqladmin-u root -p shutdown
再net start mysql就没有这个错误提示了!
*************
2
MySQL的1067错误
Q:我的Mysql碰到了 1 ......

nagios 检查 mysql服务

 http://blog.c1gstudio.com/archives/602
nagios_plugin安装时正确关联mysql后会在libexec下产生check_mysql文件
/usr/local/nagios/libexec/check_mysql -h
 
check_mysql v2034 (nagios-plugins 1.4.13)
Copyright (c) 1999-2007 Nagios Plugin Development Team
        < ......

apache和mysql重启命令

 
修改linux服务器的http配置之后,必须重启Apache服务,命令为: /etc/rc.d/init.d/httpd restart
chown -R mysql:mysql 目录名 改变文件属性
mysqladmin -u root -p password 'new password' 设置密码
apt-get remove 删除软件
apt-get clean 清理
/etc/rc.d/init.d/mysqld restart
php 就配置了session 主 ......

java 插入数据到 mysql 乱码 最佳解决

 手动建表:
CREATE TABLE `excel` (
  `id` int(11) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `passwd` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=gb2312;  注意是gb2312
然后在连接数据库时加上:
useUnicode=true&characterEncoding=gb2312.
就ok啦! ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号