linux安装mysql

yum install mysql 


yum install mysql-server


开启服务  service mysqld start   或  /etc/init.d/mysqld start


设置root密码   mysqladmin password '123'   ;  


root账户登录后,创建新用户

 grant all privileges on *.* to zhoufeng@'%' identified by '123';   //创建新用户zhoufeng  ,密码为123  并且给他所有的权限

grant all privileges on *.* to zhoufeng@localhost identified by '123';   //给该用户在localhost上面的权限,和密码



你可能感兴趣的:(linux,mysql,service)