Question

Set up a website with a database on a webserver

Hello, a while ago I set up a teamspeak server on an ubuntu 14.04 x64 server, no problems with this whatsoever. But recently I also wanted to make this server perform as an webserver. So I installed the LAMP stack and phpmyadmin. And I transfered my files trough WinSCP. When I go to the ip-adres I can see the homepage but I can’t really go further than that because all of the other pages require the database. So my question is, where and how do I put the mysql tables? Everything worked when I ran the site on my local WAMP so I would like it if it also worked on a real webserver. I hope someone can help me. Thanks in advance!

Subscribe
Share

@bananacakeman - See this DO tutorial and look for the section “Backing Up”, which also has the restoration commands. Another alternative is to use phpMyAdmin. As I recall, with phpMyAdmin you can do export/import.

You can set up all your mySQL tables, etc… via (terminal)/command line, and there’s a couple GUI mySQL things out there. Here’s a small example of command to create your database, after that it’s a matter of the actual tables you need… and so on. I know this leaves a lot to do… but there’s plenty of resources out there on DBA admin.

CREATE DATABASE foo;
GRANT ALL PRIVILEGES ON foo.* TO "foo-dba"@"localhost" IDENTIFIED BY "foopassword";
GRANT DELETE, INSERT, SELECT, UPDATE ON foo.* TO "foo"@"localhost" IDENTIFIED BY "anotherpassword";

Thank you! I installed phpMyAdmin already so I’ll check it out!

Thanks for your response! The website is self written so I didn’t use Wordpress or anything. Is it possible to copy my existing database to the server or do I have to make the whole database all over again? (Because I don’t really get what you mean by the commands) And do you have any proposals for a good tutorial or something to get started with this thing?

Which CMS are you using? Wordpress?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @sandidgec:

You can set up all your mySQL tables, etc… via (terminal)/command line, and there’s a couple GUI mySQL things out there. Here’s a small example of command to create your database, after that it’s a matter of the actual tables you need… and so on. I know this leaves a lot to do… but there’s plenty of resources out there on DBA admin.

CREATE DATABASE foo;
GRANT ALL PRIVILEGES ON foo.* TO "foo-dba"@"localhost" IDENTIFIED BY "foopassword";
GRANT DELETE, INSERT, SELECT, UPDATE ON foo.* TO "foo"@"localhost" IDENTIFIED BY "anotherpassword";

View the original comment