Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void main(String[] args) {
- try
- {
- Class.forName("com.mysql.jdbc.Driver");
- }
- catch (ClassNotFoundException e)
- {
- e.printStackTrace();
- return;
- }
- try
- {
- Connection connection = DriverManager.getConnection("jdbc:mysql://192.168.105.101:3306/world", "root", "1997");
- Statement statement = connection.createStatement();
- }
- catch(Exception e)
- {
- System.out.println("Connection Failed!");
- e.printStackTrace();
- return;
- }
- }
- }
- [mysqld]
- ...
- bind-address = 0.0.0.0
- sudo service mysql restart
- SELECT user,authentication_string,plugin,host FROM mysql.user;
- CREATE USER 'юзер'@'%' IDENTIFIED BY 'невзламываемый_пароль';
- GRANT ALL PRIVILEGES ON *.* TO 'юзер'@'%' WITH GRANT OPTION;
- SELECT user,host FROM mysql.user;
- SHOW GRANTS FOR 'юзер'@'%';
Add Comment
Please, Sign In to add comment