Error Can t connect to MySQL server on my application com 10061

0 votes

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

I tried like:

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 causes this error and how can I connect to the remote database?

Aug 19, 2020 in PHP by kartik
• 37,510 points
1,732 views

1 answer to this question.

0 votes

Hello @kartik,

To directly login to a remote mysql console, use the below command:

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

For example

mysql -u root -p'root' \
        -h 127.0.0.1 -P 3306 \
        -D local

no space after -p 

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

Hope it helps!!

Thank you!!

answered Aug 19, 2020 by Niroj
• 82,880 points

Related Questions In PHP

0 votes
1 answer

Invalid argument supplied for foreach() on line 25. Error in my php and mysql

Hello @viven , This should be a simple fix ...READ MORE

answered Aug 4, 2020 in PHP by Niroj
• 82,880 points
3,888 views
0 votes
1 answer

Error:Cannot connect to database server Communications link failure

Hello @kartik, Setting the bind-address to the server's network IP ...READ MORE

answered Aug 19, 2020 in PHP by Niroj
• 82,880 points
1,001 views
0 votes
1 answer

How can I connect to MySQL in Python 3 on Windows?

Hello @kartik, You should probably use pymysql - Pure Python ...READ MORE

answered Aug 20, 2020 in PHP by Niroj
• 82,880 points
703 views
0 votes
1 answer

How to access PHP var from external javascript file?

Hello @kartik, You don't really access it, you ...READ MORE

answered Jul 6, 2020 in Java-Script by Niroj
• 82,880 points
7,176 views
0 votes
1 answer

How do I escape a single quote in SQL Server?

Hello @kartik, Single quotes are escaped by doubling ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,880 points
5,886 views
0 votes
1 answer

How to specify a port to run a create-react-app based project?

Hello @kartik, You could use cross-env to set the port, ...READ MORE

answered Jul 22, 2020 in Angular by Niroj
• 82,880 points
5,332 views
0 votes
1 answer

How do you set a default value for a MySQL Datetime column?

Hello @kartik, In version 5.6.5, it is possible ...READ MORE

answered Aug 18, 2020 in PHP by Niroj
• 82,880 points
7,404 views
0 votes
1 answer

Error:Lost connection to MySQL server at 'reading initial communication packet', system?

Hello, You have to follow the below steps: bind-address ...READ MORE

answered Apr 9, 2020 in PHP by Niroj
• 82,880 points
20,440 views
0 votes
2 answers

Error:“Cannot Connect to Server - A network-related or instance-specific error”?

Hello, The "sql server error 40" is appears mostly ...READ MORE

answered Aug 18, 2020 in PHP by Fantazma
• 140 points
28,334 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP