CentOS7.2安装MySQL 5.7.10
1.下载MySQL源
wget http://dev.MySQL.com/get/mysql57-community-release-el7-7.noarch.rpm
2.安装MySQL源
sudo rpm -ivh mysql57-community-release-el7-7.noarch.rpm
3.安装mysql-community-server
sudo yum install mysql-community-server -y
4.重启mysql
systemctl restart mysqld
注:自动启动服务用 systemctl enable mysql
5.查看临时密码
grep 'A temporary password' /var/log/mysqld.log
2015-12-24T08:04:50.296020Z 1 [Note] A temporary password is generated for root@localhost: 4-/ni>BOP!pO
6.用临时密码登录mysql并修改root密码,新增用户,打开远程访问
>mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.7.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> alter user 'root'@'localhost' identified by ‘Abcd!1234';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> create user hadoop identified by ‘Abc123///‘
Query OK, 0 rows affected (0.00 sec)
开放远程连接授权
mysql>grant all privileges on *.* to 'root'@'%' identified by ‘Abc123///' with grant option;
Query OK, 0 rows affected, 1 warning (0.00 sec)
7.打开防火墙并重启防火墙,确认端口
iptable文件放到/etc/sysconfig下
service iptables start
sudo firewall-cmd --permanent --add-service mysql
systemctl restart firewalld.service
iptables -L -n|grep 3306
再修改my.cnf
[root@flyHome gaoxiang]# vi /etc/my.cnf
在[client]下添加
default-charater-set=utf8
loose-default-character-set (上句启动报错时可用此代替)
在[mysqld]下添加
collation_server = utf8_general_ci
character_set_server = utf8
保存退出后重启mysqld:
[root@flyHome gaoxiang]#service mysqld restart
完成以上的操作就OK了。
看一下效果:
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
Centos7 防火墙
http://www.cnblogs.com/phpshen/p/5842118.html
service iptables status 查看防火墙状态
service iptables start 开启防火墙
service iptables stop 关闭防火墙
service iptables restart 重启防火墙
jdk
yum install java-1.7.0-openjdk
yum install java-1.7.0-openjdk-devel
Tomcat
tar -zxv -f apache-tomcat-7.0.29.tar.gz // 解压压缩包
[root@linuxidc local]# rm -rf apache-tomcat-7.0.29.tar.gz // 删除压缩包
[root@linuxidc local]# mv apache-tomcat-7.0.29 tomcat
rpm -ivh jdk-8u25-linux-x64.rpm