当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > 我的mysql筆記

Unix/Linux
Linux 网管 123 --- 第6章. 一般系统管理问题 -3.变更使用者密码
Linux 网管 123 --- 第6章. 一般系统管理问题 -4.关闭删除使用者帐号
Linux 网管 123 --- 第6章. 一般系统管理问题 -5.Linux 密码及 S
Linux 网管 123 --- 第6章. 一般系统管理问题 -6.关闭系统及重新启动
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -1.HTTP
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -2.DNS
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -3.使用 TACACS
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -4.使用 Samba
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -5.使用 Netata
Linux 网管 123 --- 第7章. 自订的组态及管理内容 -6.NFS
Linux 网管 123 --- 第13章. 其他的问题 2.哪里可以找到帮助
Linux 网管 123 --- 第13章. 其他的问题 3.附带文件的指示
RedHat 6.2 中文显示与输入的设置
RedHat 6.2 中文 TrueType 字体的使用
Linux 网管 123 --- 第13章. 其他的问题 1.系统损毁
Linux系统中网络配置详解
如何配置linux与win2000/NT 双重引导
kernel hacking简单入门
Linux下如何刻录任何文件系统格式的光盘?
编译内核make dep 是啥意思 ?

Unix/Linux 中的 我的mysql筆記


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-01   浏览: 105 ::
收藏到网摘: n/a


忘记mysql 的root 密码:
先确认已经杀掉mysqld 进程了,然后执行这个
/usr/bin/safe_mysqld --skip-grant-tables &
再这样登录
mysql -h 192.168.1.2 -u root
上边的192.168.1.2 是cloud 的mysqld 运行机器,你换成自己的,这样登录上
去,就可以修改密码了。
修改密码
1.mysql -h hostname –u root 命令登录到mysqld server 用grant 命令改变口令:
Grant all on *.* to root indentified by "111111"
2. mysqladmin -u 用户名-p 旧密码password 新密码
例1:给root 加个密码ab12。首先在DOS 下进入目录mysqlbin,然后键入
以下命令
mysqladmin -uroot password ab12
注:因为开始时root 没有密码,所以-p 旧密码一项就可以省略了。
2、例2:再将root 的密码改为djg345。
mysqladmin –u root -pab12 password djg345 (注意-p 不要和后面的密码分
开写,要写在一起)
3.
use mysql; update user set password =password('yourpass') where user='r
oot'
4. 载入权限表: `mysqladmin -h hostname flush-privileges' ,或者使
用SQL 命令`FLUSH PRIVILEGES'。(当然,在这里,你也可以重启mysqld。)
mysql 的建库,添加数据方法:
mysqi –u root
mysql>create database ttt;
mysql>source 1.txt

mysql>load data local infile "2.txt" into table board;
1.txt 内容:
CREATE TABLE board (
boardid int(11) NOT NULL auto_increment,
boardname char(255),
PRIMARY KEY (boardid)
);
2.txt 内容:
1 lk(Tab 键分开)
2 lklk
3 lklklk
导出database:
#mysqldump –opt ttt –uroot –p111111 > 111.sql
导入database
1. #mysql –u root –p111111 ttt < 111.sql
2. mysql>source 111.sql;
导出的多个database:#mysqldump –-databases ttt1 ttt2 ttt3 –uroot –p111111
> 111.sql
导出所有database:#mysqldump –-all-databases –uroot –p111111 > 111.sql
prowoo 回复于:2004-12-17 12:03:24 好东西!!!!
health007 回复于:2004-12-20 12:08:59 值得收藏
happywu 回复于:2005-07-17 00:57:45 好!!!