修改mysql的root密码的几种方法
作者: 肖建彬
| 可以转载, 转载时务必以超链接形式标明文章原始出处
和作者信息及版权声明
网址:http://www.xiaojb.com/archives/it/mysqlroot.shtml
Method 1:
在/usr/local/mysql/bin/下:
./mysqladmin -u root password ‘new_password’
一般安装时用此方法设置。
Method 2:
在mysql状态下:
mysql>UPDATE user SET password=PASSWORD(’new_password’) WHERE user=’root’;
mysql>FLUSH PRIVILEGES;
Method 3:
mysql>SET PASSWORD FOR root=PASSWORD(’new_password’);
补一下补知道root密码情况下修改root密码
mysqld启动的时候加上–skip-grant-tables,然后马上修改密码,修改后去掉–skip-grant-tables,然后就OK了。
想起了3年前在eyou工作的时候,为了导qmail+vpopmail+mysql的邮件用户出来,修改了root密码,但是当时eyou的系统没有使用,原来的系统因为root密码而不能使用,我就看libvpopmail.a,从二进制文件中找到了密码:)
相关文档:
备份与恢复在任何数据库里面都是非常重要的内容,特别是随着数据量的增加,备份问题会越来越突出,因此,好的备份方法与备份策略是非常重要的。结合我所做的项目本身,下面主要就windows平台下MySQL(5.0)数据库的常用备份与恢复做一些总结。
1 相关准备工作
......
http://blog.chinaunix.net/u/14014/showart_490462.html
mysql>show variables like '%timeout';
打印结果如下:
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| connect_timeout | 5 |
| delayed_insert_timeout | 300 |
| interactive_ ......
1、新建表test create table test1( field1 int not null ) ENGINE=MyISAM DEFAULT CHARSET=gbk; insert into test1(field1) values(1); 2、删除已存在的存储过程 -- 删除储存过程 delimiter // -- 定义结束符号 drop procedure p_test; 3、mysql存储过程定
1、新建表test
create table test1(
field1 int not null
)
......
1.关键字
auto_increment
2.自增用法
例:
CREATE TABLE animals ( id mediumint not null auto_increment,
name char(30) not null,
primary key (id));
3.关于自增
Q:怎么获得当前的自增的最大值?
A:select @@identity
Q:怎么获得table的当前自增最大值?
A:select max(i ......