connect to remote mysql server code example
Example 1: mysql remote connection command line
mysql --host=localhost --user=myname --password mydb
Example 2: how to connect to the database as root user in linux
mysql -u root -p
Example 3: how to connect to the database as root user in linux
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';