0

I have a sql command I want to use to connect to my online database

mysql -h your_ddbb_server_ip -u your_user

I've installed MySQL installer 5.5 and ran the program.

After installing I tried running the command from both command prompt and a program called 'MySQL 5.5 Command Line Client'.

Neither program responded to the command.

How and where do I run this?

1
  • 1
    You would run that from the command line. After you installed the MySQL client, did you add mysql.exe to your PATH? If not, that would likely be why it isn't working from the command line. Commented Jun 6, 2012 at 13:20

1 Answer 1

1

From a command prompt (cmd.exe)

be sure you have the mysql bin folder in the path (the installer prompts for that) so you can just type mysql.exe (or just mysql).

Otherwise you have to navigate to the MySql bin folder (in my case that's C:\Program Files\MySQL\MySQL Server 5.5\bin

cd "C:\Program Files\MySQL\MySQL Server 5.5\bin"
mysql -h your_ddbb_server_ip -u your_user

This command will launch an interactive shell. If you just want to execute a command you have to specify the -e argument

mysql -h your_ddbb_server_ip -u your_user-e "SHOW DATABASES"
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.