To add a database to a Java project
1. Add code to create database (similar to SQL statement)
Add init schema.sql database syntax creation file to test resource file
2. Adding database in POM file depends on MySQL connector Java and mybatis spring boot starter
<!--Add database dependency-->
<dependency>
<groupId>mysql</groupId> ...
Posted by sergio-pro on Thu, 30 Apr 2020 10:00:21 -0700
The use of JDBC and SQL injection
Basic JDBC usage:
package demo;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.junit.Test;
/**
* Test query class for all users
*
*/
public class QueryAll {
@Test
public void testQueryAll(){
Connection conn= nul ...
Posted by gat on Thu, 30 Apr 2020 08:28:14 -0700
The detailed steps of java connecting mysql database
The detailed steps of java connecting mysql database
Connection Description:
a. The driver of mysql connection
b. mysql database installation
c,eclipse
e. Whether the database service is open (control panel - management tool - Service - find the corresponding service of mysql)
f. Create a database
1. Create a new java project and t ...
Posted by dsjoes on Thu, 30 Apr 2020 07:09:14 -0700
Spring and MyBatis integrate to automatically generate text type pit in the code
After Spring and MyBatis are integrated, dao and mapper configuration files are generated by using the automatic code generation tool. The steps are as follows (take Intelli idea as an example).
Write the generate code configuration file generatorConfig.xml.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
...
Posted by matthew1 on Thu, 30 Apr 2020 05:27:55 -0700
Examples of basic queries for databases
1. Create required tables and insert data
#Create Data Table
mysql> create table fruits ( f_id char(10) not null, s_id int not null, f_name char(255) not null, f_price decimal(8,2) not null, primary key(f_id) );
#insert data
mysql> insert into fruits(f_id,s_id,f_name,f_price)
-> values('a1',101,'apple','5.2'),
-> ('b1',101, ...
Posted by nightdesigns on Wed, 29 Apr 2020 11:19:05 -0700
Binary installation of mysql installation
Download the tar of mysql binary installation file, and place the GZ package in / usr/local /
Run script file
#!/bin/bash
function Cuser
{
groupadd -g 27 -o -r mysql
useradd -M -N -g mysql -o -r -d /usr/local/mysql/data -s /bin/false -c "MySQL Server" -u 27 mysql
}
function file-tar
{
cd /usr/local/ ...
Posted by Jay87 on Wed, 29 Apr 2020 08:59:44 -0700
ProxySQL cluster configuration
ProxySQL cluster
Experimental environment informationMySQL master-slave information
IP 1
role
188.188.0.68
Node1
188.188.0.69
Node2
188.188.0.70
Node3
ProxySQL service node
IP 1
role
188.188.0.68
Node 68
188.188.0.71
Node 71
ProxySQL version: 2.0.3-29-g00f26d5
1, ProxySQL service installation
Install the same version of P ...
Posted by rbarnett on Wed, 29 Apr 2020 03:26:43 -0700
Using ProxySQL to realize MGR multi main mode load balancing
MGR multi main mode configuration load balancing
Experimental environment informationMySQL master-slave information
IP
role
188.188.0.68
Node1
188.188.0.69
Node2
188.188.0.70
Node3
ProxySQL version: 2.0.3-29-g00f26d5
>>>Server and user configuration<<<
1. Add backend database server
Admin> SELECT * FROM mysql_s ...
Posted by Ferenc on Wed, 29 Apr 2020 02:42:27 -0700
The solution to the error of PHP connecting MySQL 8.0
After MySQL is upgraded to 8.0, how to solve the problem of PHP connection error?
As a senior MySQL ticket pal, I've been blowing water for 8.0 recently. We know that several MySQL courses have been upgraded to version 8.0 since last year. My VPS has been trying to upgrade for a long time, but the PHP version is too low. I'm worried about ...
Posted by Frank H. Shaw on Wed, 29 Apr 2020 00:54:43 -0700
ProxySQL official file translation
14_ProxySQL_Configuration
Note: during the writing time of the article from April 201904 to may 201905, subsequent official updates in github were not written
~~How to configure proxysql in the simplest way
This simple HOWTO describes how to configure some components of ProxySQL step by step. Note, however, that this is not a complet ...
Posted by sri2002 on Wed, 29 Apr 2020 00:17:06 -0700