欢迎来到天天文库
浏览记录
ID:31840597
大小:112.06 KB
页数:7页
时间:2019-01-20
《linux部署tomcat,mysql,jdk》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、mysql安装1.在线安装命令yum-yinstallmysql-server2.装入Service启动服务/etc/rc.d/init.d/mysqldstart或者servicemysqldrestart3.设置mysql服务开机自启动chkconfigmysqldon4.查看mysql开机自启动设置情况chkconfig--listmysqld (mysqld0:off1:off2:on3:on4:on5:on6:off) ←如果2--5为on的状态就OK5.查看当前mysql版本信息mysql--version 6.修改mysql默认编码和sql语句执行的最大长度执行vi/etc/m
2、y.cnf命令在[mysqld]最后增加:default-character-set=utf8character-set-server=utf8init_connect='setnamesutf8'max_allowed_packet=50Mwait_timeout=27594000重启mysql命令:servicemysqldrestart进入到mysql查看超时时间:showglobalvariableslike'wait_timeout';7.进入mysql中查看当前编码mysql>showvariableslike'%character%'; 8.设置访问权限和密码mysql>gra
3、ntallprivilegeson*.*to'root'@'%'identifiedby'admin'; mysql>grantallprivilegeson*.*to'root'@'localhost'identifiedby'admin'; mysql>flushprivileges; 9.查看当前已经设置的访问权限状态mysql>selectuser,host,passwordfrommysql.user;10.重启mysql服务servicemysqldrestart或者/etc/init.d/mysqldrestart 11.删除mysql(安装出错时再执行)yumremovemy
4、sqlmysql-servermysql-libscompat-mysql51 rm-rf/var/lib/mysql rm/etc/my.cnf12.查看是否存在mysql(安装出错时再执行)rpm-qa
5、grepmysql //有的话继续删除 rpm-qlmysql //查看文件位置13.注:重启服务器:reboot八、JDK安装1.将安装包jdk-7u71-linux-x64.tar.gz拷贝到/opt/java目录2.将包权限改成777chmod777jdk-7u71-linux-x64.tar.gz3.解压[root@localhostjava]#tar-xvfjdk-7u71
6、-linux-x64.tar.gz4.修改解压后的目录的权限[root@localhostjava]#chmod-cfvR777jdk1.7.0_71/5.修改环境变量:[root@localhostjava]#vi~/.bashrcexportJAVA_HOME=/opt/java/jdk1.7.0_71exportJRE_HOME=${JAVA_HOME}/jreexportCLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/libexportPATH=${JAVA_HOME}/bin:$PATH如下:6.使配置的环境变量生效[root@localhostj
7、ava]#source~/.bashrc7.使这个JDK为系统默认JDK对于多jdk环境比较有用(如果环境是新的无需执行下面语句)[root@localhostjava]#update-alternatives--install/usr/bin/javajava/opt/java/jdk1.7.0_71/bin/java300[root@localhostjava]#update-alternatives--install/usr/bin/javacjavac/opt/java/jdk1.7.0_71/bin/javac300[root@localhostjava]#update-alter
8、natives--install/usr/bin/jarjar/opt/java/jdk1.7.0_71/bin/jar300[root@localhostjava]#update-alternatives--install/usr/bin/javahjavah/opt/java/jdk1.7.0_71/bin/javah300[root@localhostjava]#update-alternatives-
此文档下载收益归作者所有