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

四种在MySQL中修改root密码的方法

 <>整理了以下四种在MySQL中修改root密码的方法,可能对大家有所帮助!
方法1: 用SET PASSWORD命令
  mysql -u root
  mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');
方法2:用mysqladmin
 
  mysqladmin -u root password "newpass"
  如果root已经设置过密码,采用如下方法
  mysqladmin -u root password oldpass "newpass"
方法3: 用UPDATE直接编辑user表
  mysql -u root
  mysql> use mysql;
  mysql> UPDATE user SET Password = PASSWORD('newpass') WHERE user = 'root';
  mysql> FLUSH PRIVILEGES;
在丢失root密码的时候,可以这样
  mysqld_safe --skip-grant-tables&
  mysql -u root mysql
  mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';
  mysql> FLUSH PRIVILEGES;
转自:http://shansren.blog.51cto.com/936097/215027


相关文档:

分享一个mysql类~

 
<?php
/**
* 操作mysql
的基础类,其它与mysql有关的类都继承于此基类
*
* 此class中的$table都是已经包含表前缀的完整表名
*
* ver 20090717
* 使用范例
* $db = new DB('localhost','root','password','database','utf8');
* $db->debug = true;
* $db->primaryKeys = array (
* 'table_1 ......

mysql alter 语句用法,添加、修改、删除字段

//主键
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//增加一个新列
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default '0';
//删除列
alter table t2 drop column c;
//重命名列
......

Using JDBC with MySQL, Getting Started

http://www.developer.com/java/data/article.php/3417381/Using-JDBC-with-MySQL-Getting-Started.htm#Preface
Preface
Purpose
The purpose of this lesson is to get you beyond the initial hurdles involved in:
Downloading and installing a MySQL database server.
Preparing that database for use with JDBC ......

将远程数据库倒到本地的方法(MySql)

Dos进入MySql的bin目录,执行:mysqldump -h远程数据库IP 数据库名字 -u远程数据库用户名 -p远程数据库密码 --add-drop-table | mysql 本地数据库名字 -u本地数据库用户名 -p本地数据库密码
在局域网内测试成功 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号