Creating a Database: Difference between revisions
Jump to navigation
Jump to search
(Add basic database creation instructions) |
m (Fix code block) |
||
Line 9: | Line 9: | ||
Make a note of the password for later. | Make a note of the password for later. | ||
This creates a database named <code>'''''example'''''</code>, along with a user of the same name with full access to only that database, and outputs the password. The password is also saved in a files with restricted access in the <code>/home/sympl | This creates a database named <code>'''''example'''''</code>, along with a user of the same name with full access to only that database, and outputs the password. The password is also saved in a files with restricted access in the <code>/home/sympl</code> directory for future reference. | ||
===Configuring your application=== | ===Configuring your application=== |
Revision as of 11:20, 30 July 2022
Now that you've created a website for your example.com
PHP application, you need to connect it to a database.
Example
Creating the database
Run
sympl create database example
to create a database using the Sympl Command Line.
Make a note of the password for later.
This creates a database named example
, along with a user of the same name with full access to only that database, and outputs the password. The password is also saved in a files with restricted access in the /home/sympl
directory for future reference.
Configuring your application
Now add the database credentials to one your application's configuration files. This will vary depending on your application, so consult it's own documentation.
For our example, the values we need are:
- Database:
example
- User:
example
- Password: (the password you made a note of earlier)
- Host:
localhost
- Port:
3306
Common places to find this configuration file are:
.env
config.php
config.inc.php
config/
directory