Can't Connect to MySQL Server through Xcode application even tho I am able to connect it via Terminal
问题 I'm trying to create an application that fetches data from the MySQL server. I installed MySQL from Homebrew and using the PerfectMySql swift package. I want to test it on my localhost first but I'm unable to connect it from my application . When I mysql -u root -p in the command line, it works as it should. My code for MySQL connection: import PerfectHTTP import PerfectHTTPServer import PerfectMySQL import Foundation public class DB { let host = "localhost" // or "127.0.0.1" let user = "root