How would a beginner run the sql file against his selected mysql database?

Question about cpanel website hosting: I manage a small website I built with a WYSIWYG hosted on cPanel 11.25.0-STABLE, and am trying to install a little free PHP timeclock I found. I’ve already uploaded all the files to my File Manager, but I’m unfamiliar with mysql and don’t know how to proceed with the setup.
Thanks!


Answer: From your cpanel website hosting query above, why not try MyHosting. If you are looking for a web hosting service or if you need “unlimited” hosting service, we highly recommend you go with myHosting. If you are looking for a company with very few negative comments, then try search for MyHosting review to see what we mean. MyHosting also give free domain name, unlimited bandwidth, unlimited storage, unlimited add-on domains, friendly Site builder and much more for such a low monthly price. You can get MyHosting for only $4.84/month.

MyHosting Coupons: If you need a VPS instead of just cpanel website hosting, you can enter the Coupon Code below during checkout to get Up to 6 months FREE on VPS plans at MyHosting. If you want both Windows (Microsoft) and Linux Platform in one hosting plan, including unlimited diskspace and bandwidth, with 20 Exchange-based Email – then the coupon below takes $10 off the Premium myHosting plan.




We hope our answer about cpanel website hosting has helped to solve your problem. If not, you can try alternative answers below. If you have a better answer, please leave a comment in the box below.

2 Responses to “How would a beginner run the sql file against his selected mysql database?”

  • There is a php tool called phpMyAdmin that exposes the layers of your MySql DB. Clunky, but there isn’t anything better for the price (free). There is an import feature for SQL.

    You need that page tool. You need to see how it installs. And, most importantly, you need to learn how to lock it away. Too many noobs leave phpMyAdmin unguarding the back door of their web site. So, learn how to create a privileged folder to install phpMyAdmin.

    Linux would have been a whole lot, like 1,000,000 times easier and more secure. You should be aware of that.

  • Two ways:

    in your cPanel, you have a ‘Shell Access’ or ‘SSH Terminal’. This is how you access the Unix/Linux box hosting your website. Within this terminal, you can add/delete from / modify anything pertinent to your page. Including MYSQL entires.

    In your cPanel, you have a tiny link to ‘phpmyadmin’. phpmyadmin is a graphics user-interface for displaying and working with mysql data. Much like any other graphics interface, you are presented with a multitude of options for working mysql data —- one of them, namingly, the import feature.

    with the SSH terminal you can simply login to my sql by doing

    mysql -u username -p

    leave it blank after the -p you will be prompted to enter your mysql password. enter it now.

    Cool. now you know how to log in through a terminal; let’s discuss procedure for uploading data into an existnig database. For this example our existing database is named "mydb1"

    mysql -u username -p mydb1 < /location/of/the/file/i/want/to/upload.sql;

    If the name of the database is correct, and the location to the file that you want to upload into your sql is correct (probably going to end up being something like /var/lib/mysql/upload.sql), then this will auto integreate into your database. If there are no matching tables to fit to upload.sql, new tables will be created based upon the data that exists in upload.sql.

    For all intents and purposes, this is simply an example. In this situation, you are completely overwriting the existing database ‘mydb1′ with the upload.sql file. You don’t want to do that.