Centos6.8 installation mysql5.7.x method step practice

One installation:
http://www.cnblogs.com/ziziwu/archive/2012/02/01/2335102.html
Package conflict, query installed package:
rpm -q mysql-lib
Uninstall conflict package:
rpm -e --nodeps mysql-libs-5.1.73-7.el6.x86_64
install:
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

two start and link
http ://www.aiezu.com/db/mysql_cant_connect_through_socket.html
Whether mysql is started:
lsof -i:3306
Startup method:
service mysqld start


Three login
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;


5 CREATE USER
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";

Six iptables settings
http://www.cnblogs.com/ccdc/archive/2012/04/24/2468048.html
The roughest method: 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

View the rules: iptables -L

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326351696&siteId=291194637