RHEL5.4下使用Apache+PHP+MySQL配置LAMP服务器(2)

mysql> use db_ceshi;
Database changed
mysql> create table users (username char(30) NOT NULL,userpasswd char(20) NOT NULL Default '123456',Primary key (username));
mysql> insert into users(username,userpasswd) values ('zhangsan',encrypt('123456'));
mysql> insert into users(username,userpasswd) values ('lisi',encrypt('123456'));
11、select语句
mysql> select * from users;
mysql> select * from users where username='zhangsan';
12、update语句
mysql> update users set username='qq' where username='zhangsan';
也可以更改root管理的密码,不过需要执行flush privileges命令
mysql> update mysql.user set password=password('123456') where user='root';
mysql> flush privileges;
13、delete语句
mysql> delete from users where username='lisi';
删除所有密码为空的mysql用户
mysql> delete from mysql.user where user='';

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wygzyx.html