Jump to content

how to setup and run a mysql-server - remotley


dil_bert

Recommended Posts

 

 

hello and good day

 

 

I want to make a test of the mysql-server connection remotelywell - i need to do a testdrive of the connection remotely, 


therefore i need to get access to the MySQL-server (that stands remote) from my linux-notebook. 

The procedure: i first of all need to have the ip of the server: i can use for example this one  64.45.36.17 as the IP address of the remote MySQL server:

# mysql -u fooUser -p -h 64.45.36.17 
and then i am asked for a password
i have to add or enter a password:

then the machine says 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.0.45 Source distribution


some additional commands 


we can type 'help;' or '\h' for help. Type '\c' to clear the buffer . that might be sometimes very very helpful.

mysql> _
Considerations
When we wanna set up a remote user,  we have to do some considerations: we have to consider the following information:

well a  local user is different from a remote user. This may sound trivial  but it is pretty important: 
For example, foo_bar@localhost is not the same as fooUser@1.2.3.4.5.6.7.8.9  - here you see that this is a whole other thing. 

If we want both users to have the same permissions, then we have to take care for a smart setup: We need sometimes to do a little extra work:; we sometimes have to meet the need to duplicate permissions. Belive it or not - it is true. 

well - to be honest - i really do not want to do any harm - so i don’t recommend granting ALL permissions. 
For standard users, i now do recommend granting GRANT SELECT,INSERT,UPDATE,DELETE permissions.

this is what i tell everybody...

some extra infos:  
To grant access to only a specific table, we can use the database.table command. this is a  top notch command.
For example, in the preceding step, you could use fooDatabase.fooTable instead of fooDatabase.
If you’re using iptables, you need to add an entry to your firewall rule for Transmission Control Protocol (TCP) port 3306.
 

 

 

love to hear from you

Link to comment
Share on other sites

9 hours ago, dil_bert said:

well - to be honest - i really do not want to do any harm - so i don’t recommend granting ALL permissions. 
For standard users, i now do recommend granting GRANT SELECT,INSERT,UPDATE,DELETE permissions.

this is what i tell everybody...

Then stop telling them.

The last thing you want is for standard users to be able to grant privileges. That is an admin function.

  • Like 1
Link to comment
Share on other sites

good day dear Barand many many thanks for the quick reply. 

 

Youre right - and i am glad that you pointed it out - the GRANT is not for standard users. 

 

Besides this: well i have been enabling my home computer IP address to access a online (remote) database.
question:  is there a quick way I can connect to the database from the command prompt of my laptop to make 
sure its allowing access from my IP address - and furthermore to test if the db is up and running!? well i guess that i can do it like so: 

 

use mysql client, if we allready have it installed _ to be frank it's quite easy to access a remote host

 

mysql -hyour_ddbb_server_ip -uyour_user -pyour_password your_database_name


or

mysql -h your_ddbb_server_ip -u your_user -p  your_database_name

 

* idea and note that in the first option in the code does not mean that they are no blank spaces between parameter option and its value

*idea and note:  the _database_name is optional - that said it is not 100 % necessary to give this dbname!

 

 

what do you say - does this work propperly?

 

greetings 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.