centos6.8 安装mysql5.7.x方法步骤实践

一 安装:
http://www.cnblogs.com/ziziwu/archive/2012/02/01/2335102.html
包冲突,查询已安装包:
rpm -q mysql-lib
卸载冲突包:
rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64
安装:
rpm -ivh mysql-community-common-5.7.17-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.17-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.17-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.17-1.el6.x86_64.rpm

二启动和链接
http://www.aiezu.com/db/mysql_cant_connect_through_socket.html
mysql是否启动:
lsof -i:3306
启动方法:
service mysqld start


三登录
https://zhidao.baidu.com/question/1603863845338636507.html
mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

/etc/init.d/mysqld stop
mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
mysql -u root mysql
UPDATE user SET authentication_string=PASSWORD('root') where USER='root';
FLUSH PRIVILEGES;
quit;
service mysqld start
mysql -uroot -proot
show databases;
alter user 'root'@'localhost' identified by 'rooT@0330';
mysql -uroot -prooT@0330

四创建数据库
http://blog.sina.com.cn/s/blog_6797a6700100sq9u.html
CREATE DATABASE trait_gene DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE health DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
CREATE DATABASE analysis DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;


五创建用户
http://blog.csdn.net/qq_27575627/article/details/50172673
CREATE USER trait IDENTIFIED BY 'traiT@0330';
GRANT ALL PRIVILEGES ON *.* to trait@"%"  identified by "traiT@0330";

六iptables设置
http://www.cnblogs.com/ccdc/archive/2012/04/24/2468048.html
最粗暴的方法: service iptables stop
iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -i eth0 -s 192.168.1.9 -j ACCEPT
service iptables save

service iptables restart

查看规则: iptables -L

猜你喜欢

转载自halfsking.iteye.com/blog/2366782