注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 微软企业桌面虚拟化(Micro..
 帮助

mysql命令集


2007-05-08 15:02:01
 标签:mysql命令   [推送到技术圈]

mysql -u root //第一次进入时(没有密码)
mysql -u root -p //设置root密码后
select user,host,password from mysql.user; //查看用户信息,不要忘了最后的分号
delete from mysql.user where user=''; //删除匿名用户
show databases; //查看系统已存在的数据库
drop database test; //删除名为test的空数据库
grant all privileges on test.* to centospub@localhost identified by 'yourpassword'; //建立对test数据库有完全操作权限的名为centospub的用户
select user from mysql.user where user='centospub'; //确认centospub用户的存在与否
create database test; //建立名为test的数据库
use test //连接到数据库
create table test(num int,name varchar(50)); //在test数据库中建立表
show tables; //查看test数据库中已存在的表
 




    文章评论
 
2007-05-08 21:37:33
顶了,学习一下

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: