Jump to content

[Answered] Accessing Mysql Server Via Computer's Terminal


jvicenci

Recommended Posts

Hello!

 

I'm trying to access MySQL server through my Mac's terminal. Any ideas how I can do this? I can use myphpAdmin no problem but I'ld like to be able to type my queries via my computer. What are the steps if any from the very beginning?

 

1. I have an account already.

2. I have a database set up already

3. I have a username/password associated to that database

 

Any help would be appreciated. Thank you.

Link to comment
Share on other sites

You'll have to go into your cPanel and configure Remote MySql, once you do that you can read up on http://dev.mysql.com/doc/refman/5.5/en/mysqladmin.html to learn how to connect and run mysql queries via terminal. MySqlAdmin is installed with the MySql package for your system.

Link to comment
Share on other sites

From the command line on a mac the command should be something like

mysql --host=johnny.heliohost.org --user=jvicenci --database=jvicenci_test -p

The -p option will prompt you on the following line to enter your password which is safer than saying something like --password=123abc since that saves it in your command history.

 

On a lot of modern operating systems if you don't have access to a particular comand that you typed it will even prompt you on what the syntax is to install it and what package it's located in. For instance CentOS uses yum, and Ubuntu uses apt-get, etc etc. I'm not very familiar Macs, but I am with linux and Macs have a modified version of FreeBSD under the hood.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...