MySQL

From DreamFactory
Jump to: navigation, search
(Set up MySQL)
(Set up MySQL)
 
Line 1: Line 1:
 
===Set up MySQL===
 
===Set up MySQL===
 
+
MySQL and its clones make great system databases for DreamFactory. We frequently use MariaDB, as it is open source. For help installing MariaDB, see the [https://downloads.mariadb.org/mariadb/repositories/ | MariaDB Download System].
<pre>
+
$ sudo yum install mysql-server
+
</pre>
+
 
+
<pre>
+
$ sudo apt-get install php5-mysqlnd mysql-server mysql-client
+
</pre>
+
  
 
'''Regarding MySQL engines:'''
 
'''Regarding MySQL engines:'''
Line 20: Line 13:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
'''Note for CentOS 7:'''
+
===Driver===
As of version 7 CentOS no longer includes MySQL in its repos. If you are using CentOS 7 you will need to install MySQL following these instructions [https://support.rackspace.com/how-to/installing-mysql-server-on-centos/  here], or you can use MariaDB instead of MySQL. You will still need the mysql-client.
+
The MySQL PHP driver is available in your package manager, or downloadable from php pecl.
 
+
You need to create a database, and a DreamFactory user in your MySQL instance.  On a fresh install, this is quite simple:
+
 
+
<pre>
+
$ mysql -u root
+
  
mysql> create database dreamfactory;
+
For example if you are following the [[../../../APT/Ubuntu_16.04/Modules/MySQL| Ubuntu 16.04]] instructions, this package is named php7.1-mysql.
mysql> grant all privileges on dreamfactory.* to 'dsp_user'@'localhost' identified by 'dsp_user';
+
mysql> quit
+
</pre>
+

Latest revision as of 18:23, 28 February 2018

Set up MySQL

MySQL and its clones make great system databases for DreamFactory. We frequently use MariaDB, as it is open source. For help installing MariaDB, see the | MariaDB Download System.

Regarding MySQL engines: Older versions of MySQL default to using the MyISAM engine. This engine does not support foreign key relationships and is thus not compatible with DreamFactory. The InnoDB engine is recommended for DreamFactory. Here are some suggested settings related to InnoDB that you can put in your my.cnf file

default-storage-engine = InnoDB
innodb-file-per-table = 1
innodb_stats_on_metadata = 0
character-set-server = utf8
collation-server = utf8_general_ci

Driver

The MySQL PHP driver is available in your package manager, or downloadable from php pecl.

For example if you are following the Ubuntu 16.04 instructions, this package is named php7.1-mysql.