dil_bert Posted June 5, 2019 Share Posted June 5, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/308809-how-to-setup-and-run-a-mysql-server-remotley/ Share on other sites More sharing options...
Barand Posted June 6, 2019 Share Posted June 6, 2019 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. 1 Quote Link to comment https://forums.phpfreaks.com/topic/308809-how-to-setup-and-run-a-mysql-server-remotley/#findComment-1567366 Share on other sites More sharing options...
dil_bert Posted June 6, 2019 Author Share Posted June 6, 2019 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 Quote Link to comment https://forums.phpfreaks.com/topic/308809-how-to-setup-and-run-a-mysql-server-remotley/#findComment-1567370 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.