In Linux, configuring MySql Databases on tomcat is not as simple as Windows... Therefore, it is worth writing down a record for future reference. 1. it is very easy to download and install MySQL in MySQLUbuntu. You only need to: During the installation of sudoapt-getinstallmysql-server, you will be asked to set the user name and password. My name is root, root.2 download JDBC go here to download MySQLConnect
In Linux, configuring MySql Databases on tomcat is not as simple as Windows... Therefore, it is worth writing down a record for future reference.
1. Download and install MySQL
Installing MySQL in Ubuntu is very simple. You only need:
Sudo apt-get install mysql-server
During the installation process, you will be asked to set the user name and password. Mine is root and root.
2. Download JDBC
Download MySQL Connectors for Java
Decompress the package and place the mysql-connector-java-5.1.24-bin.jar in the % atat_home/lib directory.
3. Configure Tomcat
Open the % atat_home/conf/context. xml file,
Add the following code:
Url = "jdbc: mysql: // localhost/lc">
Note that username and password are set to the value set during mySQL installation.
Then you can use JSP code to perform database operations.
However, there is still a problem, that is, when we operate mysql on the terminal, the error "mysql access denied for user" will be reported.
The solution is to enter:
Sudo mysql-uroot-p
Then enter the password of the root user to access the mysql database.
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2