MySQL数据备份

备份mysql数据库或表

命令 mysqldump

常用参数详解

1
2
3
4
5
6
7
-u  用户名
-p 密码
-h 服务器IP地址
-d 等价于--no-datab 只导出表结构
-t 等价于--no-create- info只 导出数据,不导出建表语句
-A 等价于--all-databases
-B 等价于--databases导 出一个或多个数据库

mysql命令详情

参数说明

1
2
3
4
5
6
7
8
9
10
11
12
-u 用户名
-p 用户密码
-h 服务器ip
-D 连接的数据库
-N 不输出列信息
-B 使用tab键代替默认的交互分隔符
-e 执行sql语句

其他选项
-E 垂直输出
-H 以HTML格式输出
-X 以XML格式输出

Xshell连接Ubuntu

连接操作

https://blog.csdn.net/lianghe_work/article/details/47340141

遇到的问题

  1. sudo apt-get install openssh-server报错
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    ll@ubuntu:~$ sudo apt-get install openssh-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    openssh-server : Depends: openssh-client (= 1:7.2p2-4ubuntu2.8)
    Depends: openssh-sftp-server but it is not going to be installed
    Recommends: ssh-import-id but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

解决办法 sudo apt-get install openssh-client=1:7.2p2-4ubuntu2.8
执行以上命令后在执行安装就可以了, 不过要和以上报错的版本对应

  1. root用户无法登陆
  • 在其他用户下切换sudo su root切换到root用户
  • vi /etc/ssh/sshd_config
    1
    2
    3
    <!-- 加一句去一句 -->
    PermitRootLogin yes
    # PermitRootLogin prohibit-password
  • /etc/init.d/ssh restart 来重启ssh服务
  1. /usr/bin/xauth: file /root/.Xauthority does not exist
    1
    2
    3
    4
    vi /etc/ssh/sshd_config

    添加 AllowAgentForwarding yes
    /etc/init.d/ssh restart 来重启ssh服务
  2. Ubuntu 输入正确的密码后重新返回到登陆界面

Spring/Spring的单元测试

使用步骤

  1. 导包: Spring单元测试包spring-test-4.0.0.RELEASE.jar
  2. @ContextConfiguration(locations=””)来指定Spring的配置文件
  3. @RunWith指定用哪种驱动进行单元测试,默认JUnit

    @RunWith(SpringJUnit4ClassRunner.class)
    使用Spring的单元测试模块来执行标了@Test的测试方法
    好处是不需要获取Bean

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    @ContextConfiguration(locations="classpath:ioc.xml")
    @RunWith(SpringJUnit4ClassRunner.class)
    public class SpringIOCTest {
    ApplicationContext ioc = null;

    @Autowired
    BookServlet bookServlet;

    @Test
    public void test() {
    System.out.println("--"+bookServlet);
    }
    }

40. Combination Sum II

40. Combination Sum II


题目地址


Spring IOC实验

实验1:通过IOC容器创建对象,并为属性赋值★

HelloWorld 实现

实验2:根据bean的类型从IOC容器中获取bean的实例★

如果IOC容器这个类型的bean有多个,查找会报错
报错org.springframework.beans.factory.NoUniqueBeanDefinitionException

1
2
3
4
5
6
      /*Person bean = ioc.getBean(Person.class);
System.out.println(bean);
*/
// 指定类之后不需要强转
Person bean = ioc.getBean("person02", Person.class);
System.out.println(bean);

Spring初始之HelloWorld

概述

通过各种方式给容器中注册对象
以前是自己new对象,现在交给容器创建;给容器中注册主键组件

Spring 初识

框架介绍

框架是一种可重用代码的一种设计,具有高度可重用性( 半成品
比如说,在设计一个书城项目:涉及到一些类,将它们打包为jar,再将其中一些jar抽取成高度可重用的;事务控制的,强大的Servlet,项目的一些工具
框架:多个可重用模块的集合,形成能一个领域的整体解决方案

AJAX和JSON使用

JSON

什么是JSON

JSON (JavaScript Object Notation)是(与xml对比)一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它 基于JavaScript Programing Language, Standard ECMA -262 3rd Edition - December 1999 的一个子集。JSON 采用完全独立于语言的文本格式,但是也使用了类似于C语言家族的习惯(包括C, C++,C#,Java,JavaScript, Perl, Python 等)。这些特性 使JSON成为理想的数据交换语言。

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×