desc mysql.user; //查看用户表结构
SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user; //查看数据库表中用户
select * from mysql.user where user='cactiuser' G //查看某个用户的详细信息
show grants for 'zhangs'@'localhost'; //查看某个用户对数据库的权限
select user(); //查看数据库当前登录用户
insert into mysql.user(Host,User,Password) values('localhost','xiaosu',password('su123456')); //新建一个用户
grant all on newjinlan.* to xiaosu@localhost identified by 'su123456'; //授予xiaosu用对newjinlan数据库的所有权限
grant all privileges on *.* to xiaosu@localhost identified by 'su123456'; //授予xiaosu所有数据库的权限
flush privileges; //刷新系统权限表
grant select,update on newjinlan.* to xiaosu@localhost identified by 'su123456'; //给用户部分数据库的权限
(select,insert,update,delete,create,drop等操作的权限)
DELETE FROM user WHERE User=”jeecn” and Host=“localhost”; //删除用户 (删除,修改用户信息都需要root用户来操作)
mysql -uroot -p密码
update mysql.user set password=password('su654321') where User='xiaosu' and Host='localhost'; //修改密码
flush privileges; //修改权限表完后要刷新权限表 (否则执行的操作无效)
drop database jeecnDB; //删除用户的数据库
exit / quit //退出数据库
su root //切换root账户
netstat -anp //查看端口使用情况
设置开机启动
# vi /etc/rc.d/rc.local
再配置文件里添加 /etc/init.d/mysql start
ouch /var/lock/subsys/local
yum install httpd //安装httpd
service httpd start
https://mariadb.org/
wget http://www.cmake.org/files/v2.8/cmake-2.8.8.tar.gz //从网上下载东西
https://downloads.mariadb.org/mariadb/5.5.34/mariadb-5.5.31-linux-x86_64.tar.gz
tar -zxf cmake-2.8.8.tar.gz