Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

connecting to database

  • 29-07-2010 2:42pm
    #1
    Registered Users, Registered Users 2 Posts: 1,180 ✭✭✭


    hey guys i've bought a domain recently and just today they have given me an sql database. they've given me a link to where the database log-in is(e.g. www.DOMAIN_SITE.ie/mysql_admin) aswell as my log-in details
    it all works but when i log in i just get alot of options for configuring my database
    all i want to do is log in via a terminal and use that to type in mysql commands and also to run php scripts on my website which can query my database
    in college i do this on a terminal by ssh into the college server and using 'mysql -u USERNAME -p'
    but somehow i assume this is different. can anyone help me? i'm assuming this is just a standard thing with all web domains but i have never used my own web domain for this before. i have contacted customer service of the domain-sellers but they have yet to get back to me and i need this urgently

    Thanks in advance, hope i'm making sense


Comments

  • Registered Users, Registered Users 2 Posts: 2,426 ✭✭✭ressem


    Depending on what package you got, and with which particular hosting provider, more likely than not you don't have permission to use an ssh terminal on the server.

    If the firewalls between allow port 3306, you could try
    mysql -h www.DOMAIN_SITE.ie -u username -p

    or more likely something like dbserver.DOMAIN_SITE.ie, as usually the database server is located on a different machine.

    from the mysql client's bin directory on your own computer.
    That'll try to connect to the mysql server at domain_site.

    Regarding the php scripts, it's likely that you'll have to upload them to the website's public_html directory using FTP and call them using your browser.


  • Registered Users, Registered Users 2 Posts: 1,180 ✭✭✭EyeSight


    thanks. i've been trying to guess the name of their server but to no avail. however when i use this line:
    mysql -h www.DOMAIN_SITE.ie -u username -p
    it prompts me for my password and i type it in and hit return and nothing happens. i have to ctrl+c
    yet when i try something like:
    mysql -h dbserver.DOMAIN_SITE.ie -u username -p
    it explicitly tells me there's no such server
    i guess i'll just have to wait for their customer service to get back to me. but just to be sure, is it a common thing to do what i want to do here?

    EDIT: on the phpMyAdmin page they gave me a link to it seems they have a text box to allow me to execute queries(i prefer a terminal screen) and they say somewhere on it that the server is localhost? don't know if this helps


  • Registered Users, Registered Users 2 Posts: 2,426 ✭✭✭ressem


    Sorry, I gave you the incorrect address. By dbserver.DOMAIN_SITE.ie I meant the database server that your ISP or control panel might have told you to use in a setup email.

    This could be an IP address, but as you're connecting to localhost when you use phpMyAdmin, then that would suggest that you need to use

    mysql -h www.DOMAIN_SITE.ie -u username -p

    But if that is failing to return a mysql> prompt to you, maybe you have to have a database created using the web interface, then connect to it using

    mysql -h www.DOMAIN_SITE.ie -u username -D db_name -p

    Most won't allow you to use the CREATE DATABASE command except from the web interface.


  • Registered Users, Registered Users 2 Posts: 1,180 ✭✭✭EyeSight


    hey i just got this reply from them:
    "at this time we do not offer remote MySql command line
    connections. We only allow access via the MySql-Admin [secure] web
    pages. This is a security measure to reduce the risk of the databases
    being hacked"
    so is there any point in me having a database then? because i dont see how i can get my php programs to connect to it via the MySql-Admin. i think its a very lame excuse they give? why would a professional web hosting company not give a service like this for fear of hacking?


  • Registered Users, Registered Users 2 Posts: 515 ✭✭✭NeverSayDie


    EyeSight wrote: »
    hey i just got this reply from them:
    "at this time we do not offer remote MySql command line
    connections. We only allow access via the MySql-Admin [secure] web
    pages. This is a security measure to reduce the risk of the databases
    being hacked"
    so is there any point in me having a database then? because i dont see how i can get my php programs to connect to it via the MySql-Admin. i think its a very lame excuse they give? why would a professional web hosting company not give a service like this for fear of hacking?

    See highlighted bit. Your PHP scripts are presumably not running remotely, so you should be fine.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 981 ✭✭✭fasty


    It's pretty standard practice to allow local only MySQL access like this.

    If you want to develop your site locally, install MySQL on your computer or use something like WAMP/LAMP which packages Apache, PHP and MySQL for you to make development easier.


  • Registered Users, Registered Users 2 Posts: 4,792 ✭✭✭cython


    EyeSight wrote: »
    hey i just got this reply from them:
    "at this time we do not offer remote MySql command line
    connections. We only allow access via the MySql-Admin [secure] web
    pages. This is a security measure to reduce the risk of the databases
    being hacked"
    so is there any point in me having a database then? because i dont see how i can get my php programs to connect to it via the MySql-Admin. i think its a very lame excuse they give? why would a professional web hosting company not give a service like this for fear of hacking?

    As to the bit in bold, your PHP programs should not be connecting via the command line, nor via mysql-admin, rather they should be using the inbuilt functions that open a socket connection to the database. In fact, this is what the admin package likely does in its backend, at least it would be the standard way for it to do it.


  • Registered Users, Registered Users 2 Posts: 1,180 ✭✭✭EyeSight


    ok now i understand. when i asked them i did mention i wanted to use it for both remote use and for php access. what i didn't realise was that i for the host paramater in the php function i just use "localhost".
    thanks for the help. had i known this last friday i would have saved myself so much time :p


  • Closed Accounts Posts: 22 paul.mcguinness


    Yes while the database is installed on the same machine you can use localhost, simply changing this when moving the database server to an external machine.


Advertisement