Question: I just logged into my EC2 via Putty on Windows and I got into my RDS instance and into one database I had created. Then I try to import a SQL dump from my machine with the following code which results into an error.

```
    mysql> source C:\Users\guru\Downloads\latest.sql;
    ERROR:
    Unknown command '\U'.
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source C:\Users' at line 1
    ERROR:
    Unknown command '\D'.
    ERROR:
    Unknown command '\l'.
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'uru\Downloads\latest.sql' at line 1

```

The file exists in my Windows machine. Please help me resolve the error.

Answer: 
The `Thread` constructor accepts a `Runnable` on which the `Thread` will eventually execute the `run()` method. Right now you aren't returning a `Runnable` object. you are returning `null`. So the execution you do in your `test()` and `otherTest()` methods is executed synchronously. 

All your execution happens in one thread. This

```
new Thread(new ThreadTest().test()).start();

```

executes `test()`, sleeps for a second, prints `"test"` and returns `null`. The `start()` call doesn't do anything because the `Runnable` is `null`. This continues for each other call you do.

You need to put everything in your `test()` and `otherTest()` methods inside a `Runnable#run()` method. For example 

```
new Thread(new Runnable() {
    public void run() {
         Thread.sleep((long) (Math.random()*1000));
         System.out.println("test");
    }
}).start();

```

Consider the source code of the `run()` method of `Thread` class, which is executed when `start()` is called

```
@Override
public void run() {
    if (target != null) {
        target.run();
    }
}

```

Where `target` is the `Runnable` reference you pass in the constructor. Obviously, if it is `null`, it won't do anything.
You need to implement your `test` and `otherTest` methods as `Runnable` implementations. Like so:

```
private static class Test implements Runnable {
    @Override
    public void run() {
        try {
            Thread.sleep((long) (Math.random()*1000));
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            return;
        }
        System.out.println("test");
    }
}

private static class OtherTest implements Runnable {
    @Override
    public void run() {
        try {
            Thread.sleep((long) (Math.random()*1000));
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            return;
        }
        System.out.println("Othertest");
    }
}

public static void main(String args[]) {
    new Thread(new Test()).start();
    new Thread(new Test()).start();
    new Thread(new OtherTest()).start();
    new Thread(new Test()).start();
    new Thread(new OtherTest()).start();
    new Thread(new Test()).start();
    new Thread(new Test()).start();
    new Thread(new Test()).start();
}

```

You could, of course, try to reduce the duplication a little:

```
private enum Runnables implements Runnable {
    TEST {
        @Override
        public void run() {
            if (!sleep()) return;
            System.out.println("test");
        }
    },
    OTHER_TEST {
        @Override
        public void run() {
            if (!sleep()) return;
            System.out.println("Othertest");
        }
    };

    static boolean sleep() {
        try {
            Thread.sleep((long) (Math.random()*1000));
            return true;
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            return false;
        }
    }
}

public static void main(String args[]) {
    new Thread(Runnables.TEST).start();
    new Thread(Runnables.TEST).start();
    new Thread(Runnables.OTHER_TEST).start();
    new Thread(Runnables.TEST).start();
    new Thread(Runnables.OTHER_TEST).start();
    new Thread(Runnables.TEST).start();
    new Thread(Runnables.TEST).start();
    new Thread(Runnables.TEST).start();
}

```