您的位置:首页 > 运维架构 > Linux

centos下rpm安装mysql5.6.17(一)

2014-05-06 09:26 471 查看
1、首先下载mysql的linux版本(注意,需要下载radha的版本)

MySQL-5.6.17-1.el6.i686.rpm-bundle.tar。本人只安装了MySQL-server-5.6.17-1.el6.i686.rpm 和MySQL-client-5.6.17-1.el6.i686.rpm

2、然后使用root账号登陆,进行安装:

rpm -ivh MySQL-server-5.6.17-1.el6.i686.rpm

rpm -ivh MySQL-client-5.6.17-1.el6.i686.rpm

3、启动mysql

service mysql start

4、获取root用户密码

cat /root/.mysql_secret

5、登录mysql

mysql -u root -p

1:如出现如下问题:

ERROR
2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

2:解决方法:

vi /etc/my.cnf

增加如下信息:

[client]

socket=/var/lib/mysql/mysql.sock

3:重启mysql
service mysql restart
6、修改root密码

SET
PASSWORD=password(
'password'
);


7、退出重新登录mysql


8、增加mysql 远程访问的权限

GRANT
all privileges on *.* TO
'root'
@
'%'
identified
by
'password'
WITH
GRANT OPTION;


FLUSH PRIVILEGES;


9、重启mysql
:service mysql restart


10、进行生产服务器安全配置


/usr/bin/mysql_secure_installation


#Enter current password for root  输入root密码
#Change
the root password? 是否修改root的密码

#Remove
anonymous users? 是否删除匿名账号


#Disallow root login remotely?
是否取消root用户远程登录

#Remove test database
and access to it? 是否删除test库和对test库的访问权限

#Reload privilege tables
now? 是否现在刷新授权表使修改生效
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: