CentOS 6.5下yum安装mysql 5.7

CentOS 6.5下yum安装mysql5.7并在win10下使用navicat远程连接mysql服务器

以root身份登录centos
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
yum install mysql-community-server
安装好之后,可以使用service mysqld start来启动服务
cat /var/log/mysqld.log | grep 'temporary password'来获取临时密码
mysql -u root -p 临时密码
alter USER USER() identified by '新密码';
grant all privileges on *.*  to 'root'@'%' identified by '新密码' with grant option;
flush privileges;
退出mysql
service mysqld restart
service iptables stop
vi /etc/selinux/config将enforing 改为 disabled
使用navicat以root用户3306端口连接centos的mysql服务器

注:因为为本地测试学习环境centos和mysql都以root身份登录,不太严谨,生产环境中不会以root身份登录

你可能感兴趣的:(mysql)