Build and configure MySQL and Tomcat test environments on Ubuntu

Source: Internet
Author: User
Here, the Ubuntu system uses version 11.10. If you use a virtual machine, we recommend that you use a version later than VMware6.5 for installation. if the version is old, IRQ errors will always occur during installation. after the system is installed, it is best to update the system again. The update package will be relatively large. Do not use the default data source that comes with it. The speed will be slow and sometimes cannot be connected, go to [system settings]-[software source]. On the pop-up page, replace [downloaded from] with other sites. The 163 and cn99 sites are faster. &

Ubuntu 11.10 is used here. If it is a virtual machine, we recommend that you install it in Versions later than VMware 6.5. if the version is old, IRQ errors will occur during installation.

After the system is installed, it is best to update the system again. The update package will be relatively large. Do not use the default data source that comes with it. The speed will be slow and sometimes cannot be connected, go to [system settings]-[software source]. On the pop-up page, replace [downloaded from] with other sites. The 163 and cn99 sites are faster. finally, run the sudo apt-get update command in the terminal window to make the changed data source take effect.

JAVA environment

Download the java bin installation package. After the installation is complete, you must set the environment variables to make them take effect globally,

Directly edit the/etc/profile file and add the following to the end:

Export JAVA_HOME =/usr/local/java/jdk1.6.0 _ 30 (based on the actual path)

Export PATH = $ PATH: $ JAVA_HOME/bin

Export CLASSPATH =.: $ JAVA_HOME/jre/lib: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar

MYSQL installation Configuration

There are many ways to install MYSQL. You can download the corresponding installation package from the official website, but it is relatively difficult to configure. It is very easy to install the ubuntu system online.

Open the terminal window and execute sudo apt-get install mysql-server. After the installation is complete, the system will automatically configure it. At last, set the password for the root user. We recommend that you enter it. Do not leave it blank. run whereis mysql to know the corresponding installation path.

1. Start and Stop

The following are related commands.

Sudo/etc/init. d/mysql restart

/Etc/init. d/mysql start

/Etc/init. d/mysql stop

/Etc/init. d/mysql restart

2. Modify the encoding format

Locate the/etc/mysql/my. cnf file, or directly edit sudo gedit/etc/mysql/my. cnf. Add the following content in [client] and [mysqld:

[Client]

Default-character-set = utf8

[Mysqld]

Default-character-set = utf8

Restart MYSQL and enter show variables like 'character _ set _ %.

3. enable remote management

Enter the mysql terminal, mysql-u user-p Password

Run grant all privileges on *. * TO user @ "%" identified by "password" with grant option

Open the gedit/etc/mysql/my. cnf file and find bind-address = 127.0.0.1 and change it to bind-address = 0.0.0.0.

In this way, you can manage through a remote connection.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.