How to make a MySQL database on Ubuntu server?

-1

0

I am trying to make a WordPress blog and install WP manually, but the MySQL databases are giving me headaches. Can someone explain what is MySQL and how to make a database? I am using Ubuntu Server and already have the mysql package installed.

ultrapenguin

Posted 2014-02-09T14:25:30.333

Reputation: 59

Question was closed 2014-02-12T03:10:32.103

1

I suggest googling the subject and appending "digitalocean" to your query. Digital Ocean is an excellent hosting company that is also involved in writing many quality tutorials that answer this and similar questions. Check out this one.

– jcora – 2014-02-09T14:59:24.667

Answers

4

You can run the wp-admin/setup-config.php which will ask for you MySQL information if the wp-config.php doesn't exist.

If you've unpacked the Wordpress files in your root directory simply go to http://yourdomain .com/wp-admin/setup-config.php and it should guide you through the steps.

If you are on the local machine you should be able to do http://localhost/wp-admin/setup-config.php

If you experience problems with the server, please check out this guide on how to setup LAMP https://www.digitalocean.com/community/articles/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu

You should also have a look at the WP documentation. http://codex.wordpress.org/Installing_WordPress

Hope this helps.

duxck

Posted 2014-02-09T14:25:30.333

Reputation: 147

1Thank you for this information. The websites were very helpful and now I'm getting on with installing wordpress. – ultrapenguin – 2014-02-09T14:59:30.927

2

Here's some useful background information on what a database is and how it fits into web applications:

MySQL is a SQL database server.

Databases let you arrange data in tables. Each table has a number of columns, and the name and type of data in each column is defined in a schema. You can add or delete rows, or change fields within rows (one field per column). Databases also let you keep indexes which are sorted arrangements of these tables, letting you search and retrieve data from them quickly (anytime a website offers a search capability, it's likely based on this ability of a database). There's much more to databases, it's worth looking into if you are serious about learning about web applications and how they work.

A SQL database lets you or a program store and fetch information using SQL commands. You can do things like SELECT on the database and retreive all rows in a table that match what you want.

Why do web applications like Wordpress use databases and not files for storage? Two reasons:

  • Because databases can handle multiple processes or users accessing and updating them at once. Files cannot without a lot of work (at which point you may as well use a database)
  • You can host the database on a separate server other than the same one the web app is running. This allows you to tune, re-distribute, load balance and optimize the workload if you have a big website with millions of users, etc.

SQL servers work like an operating system unto themselves - an SQL server will have users and privileges (stored within it usually in a system table). There is a "root" MySQL user (the password which you pick during install) and SQL commands can be issued to create other users. You can grant privileges to certain users on certain tables and this is good to do from a security perspective.

Sounds complex? Good news is these days most web applications do the setup work for you with a convenient installer. All you typically need to do is tell them:

  • what system the MySQL server is running on. If it's running on the same system, this is 127.0.0.1 or localhost
  • the root password of the MySQL server. The app asks for this so it can set up its own database and tables on the server.
  • You might also instead need to tell it a user and password. This would mean you'd have to set up the user and database in MySQL yourself.

If you end up having to create MySQL users and databases yourself, it's a lot easier for a non-MySQL expert to do with phpmyadmin (apt-get install phpmyadmin and then you might have to move a file from your /etc/apache2/conf.available to /etc/apache2/conf.enabled) - a web app you can install that will give you a convenient Web GUI to do most of this.

LawrenceC

Posted 2014-02-09T14:25:30.333

Reputation: 63 487

In the bottom half of your answer, is this package phpmyadmin or myphpadmin? Thanks for the clarification anyway. – ultrapenguin – 2014-02-09T16:15:14.573

its phpmyadmin, sorry. :) – LawrenceC – 2014-02-09T18:34:48.467

To note with phpmyadmin I strongly suggest to follow these steps to secure your installation of it: http://stackoverflow.com/questions/2631269/how-to-secure-phpmyadmin Also suggest to use .htaccess to secure it further than the built in login requirements. phpmyadmin has been known in some of its versions to have quite weak security.

– duxck – 2014-02-09T18:57:48.900