linux安裝jdk,mysql
vim /etc/profile
最下面
#jdk
JAVA_HOME=/usr/local/jdk1.8;
PATH =$PATH:$JAVA_HOME/bin;
export JAVA_HOME PATH
:wq
source /etc/profile讓環境變量生效
安裝mysql:
rpm -qa | grep mysql* 查看是否安裝了mysql
yum install mysql 安裝mysql客戶端
安裝mysql服務端
yum install mysql-server
yum install mysql-devel
啟動mysql:
service mysqld start
查看是否啟動: ps -aux | grep mysql*
創建root管理員:
mysqladmin -u root password fei417524333
登錄: mysql -u root -p fei417524333
show databases;
use mysql;
show tables;
select Host,user,password from user;
遠程連接:
1: inset into user(Host,user,password) values(‘%‘,‘root‘,password(‘root‘));
開放防火墻
vim /etc/sysconfig/iptables
yyp 22 復制22,然後改成3306 :wq
重啟防火墻: serivce iptables restart
重啟mysql service mysqld restart
授權超級管理員: grant all privileges on *.* to ‘root‘@‘%‘;
設置數據庫字符集:
vim /etc/my.cnf 加入(不要加到最後)
default-character-set=utf8
default-storage-engine=InnoDB
配置mysql開機自啟動
vim /etc/rc.d/rc.local
linux安裝jdk,mysql