Instead of installing XAMPP on the local environment. I want to practice code on the shared hosting that I am subscribed to a 1-year programme on the Hostgator, but I am confused for a few things. On WAMP I have worked many years back there we used to have a username “root” w/o any password?
Is that possible? Please guide me how can I create a database on Hostgator through SQL commands..
I am learning through a Video course, but that is dealing with everything in Local environment.
Assuming you’re using their shared hosting, my general response is going to be ‘it wont be possible’. The general rule of thumb is that sites like Hostgator, Godaddy, etc, generate the database for you on a shared database host, and create a user that has access to that database only. That user then cannot issue a CREATE DATABASE command at all, nor a GRANT command.
Essentially in those sorts of environments, those commands are handled by the host’s website, rather than yours.
If you’re talking about a VPS or actual private server, then you’d do the same commands as on your WAMP stack in the server (connecting through SSH)
If you’re using shared hosting, you wouldnt be installing anything. The software stack is already running on their machine, and your files simply reside there.
If you want to issue SQL commands to the remote host, HostGator say they use phpMyAdmin through their CPanel. In PMA you’ll find the ability to send SQL commands to your database, though as stated previously, the user you’ll be sending commands as is not an administrator of the entire DB server, and has simply been granted all permissions to your specific database.
Mkay, well if you are going to put that on a shared host like Hostgator, ignore the ‘create a database’ and ‘create a user for that database’ steps, because the website will do it for you. The rest of the SQL commands can be pushed through the PMA interface without really knowing much about it.
Just replace the DB username, password, and server with the ones supplied to you by Hostgator.