mysql common instructions under linux operating system
1. Access to MySQL database
It is completed by inputting mysql-uroot-p instruction, where uroot is the user name, and the option of inputting password will be displayed after execution
[it@VM_0_12_centos ~]$ mysql -uroot -p
Enter password:
2. Display of existing database
Type show databases; on the command line to display the ...
Posted by raj86 on Sun, 29 Dec 2019 21:57:32 +0100
MySQL group summary takes the first N records
score table:
CREATE TABLE `score` (
`student_id` int(10) DEFAULT NULL,
`class_id` int(10) DEFAULT NULL,
`score` int(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
Field student ID student ID, class ID: class ID, score: Score
Data preparation:
insert into score values(1,1,100),(2,1,93 ...
Posted by ltd on Sun, 29 Dec 2019 20:12:42 +0100
Using docker compose to quickly build php7+nginx+mysql5.7+redis environment in centos7
1. Install docker and docker compose
centos7 installs docker and docker compose
2. Docker compose common commands
# Build the container under the folder containing docker-compose.yml
# If you use the Dockerfile to modify the Dockerfile, execute the following again to apply the modification
docker-compose up -d
# Stop all ...
Posted by goosez22 on Sun, 29 Dec 2019 18:57:17 +0100
Install mysql under Ubuntu 16.04.1
Version information
ubuntu version: 16.04.1
MySQL server version: 5.7.23
install
First, check the mysql version available from apt
ubuntu@VM-0-4-ubuntu:~$ apt search mysql
You can see that there are two package s in the result. We can install MySQL server. You can see that the MySQL server provided is 5.7.23.
mysql-client/xenial-security,xenial ...
Posted by hwmetzger on Sat, 28 Dec 2019 18:01:48 +0100
Enterprise springboot tutorial (7) springboot enables declarative transactions
springboot is very simple to start a transaction, only one annotation is needed @Transactional Just fine. Because in springboot, events have been enabled for jpa, jdbc and mybatis by default. When they are introduced, things will be enabled by default. Of course, if you need to use other orm, such as beatlsql, you need to configure the relevant ...
Posted by adriaan on Sun, 22 Dec 2019 18:24:06 +0100
django-4 field type data constraint table relation
django
mysql
model field type
'AutoField': 'integer AUTO_INCREMENT',
'BigAutoField': 'bigint AUTO_INCREMENT',
'BinaryField': 'longblob',
'BooleanField': 'bool',
'CharField': 'varchar(%(max_length)s)',
'CommaSeparatedIntegerField': 'varchar(%(max_length)s)',
...
Posted by teng84 on Sat, 21 Dec 2019 20:57:48 +0100
Java EE Foundation (06): Servlet integration C3P0 database connection pool
Source code: GitHub point here || GitEE point here
1, C3P0 connection pool
1. C3P0 introduction
C3P0 is an open source JDBC connection pool. The application program initializes the database connection according to the C3P0 configuration, and can automatically reclaim the function of idle connection.
2. Core dependency
<dependency>
& ...
Posted by jimdy on Fri, 20 Dec 2019 15:12:28 +0100
MySQL High Availability Cluster Architecture - MHA Architecture
Introduction to MHA:
(1) Introduction
At present, MySQL is a relatively mature solution for high availability. It was developed by youshimaton, a Japanese DeNA company (now working for Facebook), and is an excellent set of high availability software for failover and master-slave promotion in MySQL high availability environment.During the MSQL ...
Posted by DaRkZeAlOt on Wed, 18 Dec 2019 23:27:33 +0100
centos installation lnmp environment (source installation)
lnmp environment construction
Preconditions
Operating system installation: CentOS 6.8 64 bit minimum installation.
Configure IP, DNS, gateway and host name
Configure firewall and open ports 80 and 3306
Close access wall
service iptables stop
/etc/init.d/iptables restart? Restart the firewall to make the configuration ef ...
Posted by lnt on Mon, 16 Dec 2019 20:26:35 +0100
A small problem in executing scala program with JAVA command line
Example of scala accessing MySQL database:
import java.sql.{Connection,ResultSet,DriverManager}
import scala.util.control.Exception.Catch
//import java.sql.DriverManager
object DataAnalysisTest {
def main(args: Array[String]): Unit = {
if(args.length!=3)
{
println("Parameter error!")
println("usage metho ...
Posted by jdimino on Mon, 16 Dec 2019 19:38:07 +0100