Answers for "connect to mysql server"

SQL
13

java connect to mysql

import java.sql.*;  
class MySqlConn{  
    public static void main(String args[]){  
        try{  
            Class.forName("com.mysql.cj.jdbc.Driver");  
            Connection conn = DriverManager.getConnection("jdbc:mysql://
            localhost:3306/databasename","username","password");  
            Statement stmt = conn.createStatement();  
            ResultSet rs = stmt.executeQuery("select * from emp");    
            con.close();  
        }catch(Exception ex){
            System.out.println(ex);
        }  
    }
}
Posted by: Guest on May-22-2020
3

mysql cli connect with password

mysql --user=root --password=mypass
Posted by: Guest on July-01-2020
1

mysql connect command

mysql --host=localhost --user=myname --password mydb
mysql -h localhost -u myname -p mydb
Posted by: Guest on February-05-2021
0

how to connect mysql local server

connect root@localhost:3306
Posted by: Guest on December-09-2020
-1

mysql connect

$mysqli -> new mysqli(host, username, password, dbname, port, socket)
Posted by: Guest on April-26-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language