Home > Database > Mysql Tutorial > body text

Ubuntu下安装JDK+TOMCAT+MYSQL

WBOY
Release: 2016-06-07 16:51:41
Original
1039 people have browsed it

点击Ubuntu的系统=gt;系统管理=gt;新立得软件包管理器搜索jdk mysql关键字,在搜索列表中选择要安装的软件源一:配置~/.bashrc

点击Ubuntu的系统=>系统管理=>新立得软件包管理器

搜索jdk mysql关键字,在搜索列表中选择要安装的软件源

一:配置~/.bashrc文件
JDK的默认安装路径/usr/lib/jvm/

在~/.bashrc配置文件中添加

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun

JAVA_BIN=/usr/lib/jvm/java-1.5.0-sun/bin

PATH=$JAVA_HOME/bin:$PATH

TOMCAT_HOME=/home/portal/apache-tomcat-6.0.13

CLASSPATH=.:$JAVA_HOME/lib:$TOMCAT_HOME/lib

export JAVA_HOME JAVA_BIN PATH TOMCAT_HOME CLASSPATH

二:配置/etc/environment
在/etc/environment配置文件中添加

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"

CLASSPATH=".:/usr/lib/jvm/java-1.5.0-sun/lib"
JAVA_HOME="/usr/lib/jvm/java-1.5.0-sun/"

三:Mysql授权远程访问
mysql>GRANT ALL PRIVILEGES ON *.* TO admin@localhost IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql>GRANT ALL PRIVILEGES ON *.* TO admin@% IDENTIFIED BY 'password' WITH GRANT OPTION;

第一句增加了一个admin用户授权通过本地机(localhost)访问,,密码“password”。第二句则是授与admin用户从任何其它主机发起的访问(通配符%)。

$sudo gedit /etc/mysql/my.cnf

老的版本中

>skip-networking => # skip-networking

新的版本中

>bind-address=127.0.0.1 => bind-address= 你机器的IP

或者将bind-address=127.0.0.1=>#bind-address=127.0.0.1注注释掉

重启MYSQL服务 $sudo /etc/init.d/mysql restart

则可以远程访问MySQL了。

四:关于Ubuntu MySQL字符乱码
$sudo gedit /etc/mysql/my.cnf

[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8

重启MYSQL服务 $sudo /etc/init.d/mysql restart

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!