devWhiz Posted April 14, 2011 Share Posted April 14, 2011 If the script is not uploaded onto the server you cant use $dbc = mysql_connect('localhost', 'username', 'pass'); so how could I connect in cli? this did not work $dbc = mysql_connect('http://123.456.789.10', 'username', 'pass'); So what can I do? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/233698-connecting-to-a-site-database-in-cli/ Share on other sites More sharing options...
requinix Posted April 14, 2011 Share Posted April 14, 2011 Just "12.34.56.78" for the hostname. Nothing else. If it doesn't work then the machine and/or MySQL isn't configured to allow remote connections. Quote Link to comment https://forums.phpfreaks.com/topic/233698-connecting-to-a-site-database-in-cli/#findComment-1201479 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.