0

I was trying to connect to MySQL database in Flutter application using sqljocky5 using the below code using dart language

void getInfo () async {
    var pool = new ConnectionPool(
        host: 'localhost',
        port: 3305,
        user: 'root',
        password: 'mysql',
        db: 'smartlender',
        max :5
    );
    print('test');
    var results = await pool.query('SELECT employee.firstName  FROM smartlender.employee;'); // exception is thrown here
    results.forEach((row){  // for each loop to add data to the list created above
      names.add(row[0].toString());
    }); 

Then I received this exception: I have working connection to MySQL database and the query is exiting without an error . I appreciate a lot if someone could resolve this issue .

4
  • Sounds like a Dart bug. What does dart --version print? Commented May 19, 2018 at 6:23
  • Please post the full output. Commented May 19, 2018 at 8:07
  • i have mistakenly taken wrong value , can u tell me hot to get dart version Commented May 19, 2018 at 12:56
  • I missed the Flutter tag. I don't think you actually want to access MySql from a mobile device directly. Commented May 19, 2018 at 14:13

1 Answer 1

1

Isn't it default Mysql port number 3306?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.