How to create a database in siteworx
With Sitworx UI you have full control over the creation of your database and user access when using our PHP or Java hosting.
Please note: You cannot create and manage users via shell. You must use Siteworx
Login to your control panel at https://domain.com:2443/siteworx/
Click Hosting features >> MySql >> Databases
In the page that opens, enter the database name, check the box to Create User and click Add as shown below
Important: Option “when connecting from” can be any of the below
- localhost if script and database is in the same server
- IP, say 126.96.36.199 if you need to access the database from that IP
- % if you need to allow access from all sources (not recommended)
If you already have a user setup for database, you can simply add existing user but clicking on [Manage Users] link after the database has been created.
After you have created your database and assigned a user, you can use PHPMyAdmin to import data or create tables.
You may also manage your database via shell after you have created the database and user. Such as importing database SQL file, mysqldump, or simply connect and use database if data exists.
When you setup your database you will provide it a name and the system will automatically prefix your account username to your database name. For example if your domain is mydomain.com then your virtual account username would be mydomai and if you name your database sam then your actual database name would be mydomai_sam. So that is what you use in your database connection string. The username is handled the same way.
Note: 'root' is a reserved word so you cannot use this in your database name or username. For example something_root will fail to connect.