Access MySQL Remote Databases from Command Line

I have a server with Rackspace. I want to access the database from the command line of the local machine.

I have tried:

mysql -u username -h my.application.com -ppassword

But it gave an error:

< p>ERROR 2003 (HY000):

Can’t connect to MySQL server on’my.application.com’ (10061)

The reason for this error is What? How to connect to a remote database?

To log in directly to the remote mysql console, use the following command:

mysql -u {username} -p'{password}' \
-h {remote server ip or name} -P {port} \
-D {DB name}

It will directly enter the mysql console by switching to the mentioned database.

31-07-2019 – Edit syntax

< /p>

I have a server with Rackspace. I want to access the database from the command line of the local machine.

I have tried:

< pre>mysql -u username -h my.application.com -ppassword

But it gives an error:

ERROR 2003 ( HY000):

Can’t connect to MySQL server on’my.application.com’ (10061)

What is the cause of this error? How to connect to a remote database?

To log in directly to the remote mysql console, use the following command:

mysql -u {username} -p'{password}' \
-h {remote server ip or name} -P {port} \
-D {DB name}

It You will directly enter the mysql console by switching to the mentioned database.

31-07-2019 – Edit syntax

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2991 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.