Why does my code give the " Net.createConnection is not a function" error on google chrome?

I am trying to create a database in Mysql and nodejs.To use require(); I installed browserify but now it gives the error “Net.createConnection is not a function”.How can I solve this?

var mysql=require('mysql');

var con=mysql.createConnection({
    host:"localhost",
    user:"root",
    password:""
});


con.connect(
    console.log("connected")
)