Create a MySQL Database from the Terminal/Command Line: VPS Bible




new password?
login
X
mysql logo

Here’s the MySQL syntax to add a new database from the terminal command line. It’s commonly required as part of a new site or content platform setup.

This is the most basic db setup procedure, ideal for VPS users who want full database permissions. In further tutorials we’ll look at how to shore up those permissions, adding users with limited rights for example ..

.. but this is a good starting point.

Create a MySQL Database from the Command Line

Login to MySQL with:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

.. providing your Linux user password, as prompted.

Now paste this lot, replacing username, password and databaseName with those that you wish to use for your new site or content platform, and leaving the quote marks I’ve included for the password:-


Please sign up for automatic premium content access.

Just $15/year* will save you hours, maybe days!

Alternatively, the vpsBible forum is free and you are welcome.

Linking up Your MySQL db to a Content Framework

Now you have a bare bones database you’ll be wanting to connect it, most likely, to a content management system, blog or forum.

If you’re following a specific platform guide here at vpsBible, that tutorial will explain how to connect but, essentially, you’ll be referring to the username, password and databaseName you provided above in your platform’s installation procedure.

The content framework you’re using, whether WordPress, Drupal or whatever, will then populate your new database with whatever tables are required which, once installed and ready to go, you’ll then fill with your, er, data.

So that’s nice.




Got a Question? Want to Comment?

This site has no comments system. We've got a better system!

Please use the link at the top of the post and goto this topic's forum thread:-

  • to help build community
  • for a superior knowledge base
  • to keep info in one place, not diluted between forum & comments.

For those posts ported from Guvnr.com (pre-Feb/2010), archive comments remain.

Handy info from these comments is in the process of being ported to the forum and attributed to the original author.

If you think this idea sucks, let me know.

Thank you.