Using MySQL: Difference between revisions
From ULYSSIS documentation
(Created page with "==Creating a MySQL user== To use MySQL on your ULYSSIS account you first need to create a MySQL user on [https://ucc.ulyssis.org|UCC]. In the MySQL section of the panel you wi...") |
No edit summary |
||
Line 3: | Line 3: | ||
==Creating a MySQL database== | ==Creating a MySQL database== | ||
After creating a MySQL user, you can simple press ''Add database'' in [https://ucc.ulyssis.org|UCC] and enter the name for your new database. It will automatically be prefixed by your username. | |||
==Using MySQL for your website or application== | ==Using MySQL for your website or application== | ||
Host: mysql.ulyssis.org | |||
Username: your account's username | |||
Password: the password you chose when you made the MySQL user | |||
Database: the database name you chose, prefixed by your username | |||
For example, if my username is foobar, I made a database called website and I were to create a PHP application I would use something like this: | |||
$db = new mysqli('mysql.ulyssis.org', 'foobar', 'correct horse battery staple', 'foobar_website'); | |||
$db = new PDO('mysql:host=mysql.ulyssis.org;dbname=foobar_website', 'foobar', 'correct horse battery staple'); | |||
==Managing MySQL with PHPMyAdmin== | ==Managing MySQL with PHPMyAdmin== | ||
==Accessing MySQL from outside of our network== | ==Accessing MySQL from outside of our network== |
Revision as of 01:09, 11 May 2014
Creating a MySQL user
To use MySQL on your ULYSSIS account you first need to create a MySQL user on [1]. In the MySQL section of the panel you will be suggested to click a link to create a user. Then fill in a password for the database user. It is highly recommended that this password differs from the password you use for your account. Then you just click Create user and you are ready to go.
Creating a MySQL database
After creating a MySQL user, you can simple press Add database in [2] and enter the name for your new database. It will automatically be prefixed by your username.
Using MySQL for your website or application
Host: mysql.ulyssis.org Username: your account's username Password: the password you chose when you made the MySQL user Database: the database name you chose, prefixed by your username
For example, if my username is foobar, I made a database called website and I were to create a PHP application I would use something like this:
$db = new mysqli('mysql.ulyssis.org', 'foobar', 'correct horse battery staple', 'foobar_website');
$db = new PDO('mysql:host=mysql.ulyssis.org;dbname=foobar_website', 'foobar', 'correct horse battery staple');