CentOS linux mysql 安装指南

执行yum指令安装mysql服务端软件

yum install mysql-server
yum install mysql-devel

1.启动mysqlserver
  service mysqld start
2.设置root密码
  mysqladmin -u root password '12345678;
3.配置用户和权限

[root@ rhel5~]# mysql -u root mysql

mysql>use mysql;
mysql>desc user;
mysql> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY "root";  //为root添加远程连接的能力。
mysql>update user set Password = password('xxxxxx') where User='root';
mysql>select Host,User,Password  from user where User='root';
mysql>flush privileges;
mysql>exit

重新登录:mysql -u root -p

若还不能进行远程连接,则关闭防火墙
[root@ rhel5~]# /etc/rc.d/init.d/iptables stop

相关推荐