DirectAdmin Create Database And Database User

DirectAdmin Create Database And Database User

Here’s how you can create a database, and a database user in DirectAdmin. The images in the guide below uses the default theme in DirectAdmin.

  1. Login to DirectAdmin as a User
  2. Under Account Manager, click MySQL Management

    DirectAdmin Create Database And Database User 1
    DirectAdmin Create Database And Database User 1
  3. At the right side of the page, click CREATE NEW DATABASE

    DirectAdmin Create Database And Database User 2
    DirectAdmin Create Database And Database User 2
  4. Enter your database details as shown below
    DirectAdmin Create Database And Database User 3
    DirectAdmin Create Database And Database User 3

    DirectAdmin Create Database And Database User 4
    DirectAdmin Create Database And Database User 4
  5. You will see your database details upon successfully creating the database

    DirectAdmin Create Database And Database User 5
    DirectAdmin Create Database And Database User 5
  6. Done. If you wish to import a SQL file into your database, you can do that by following the guide here

Conclusion

Try out the various options available for yourself and see what suits you best.  If you want a theme or option that is not available, you should contact your hosting provider and see if they are able to get it installed for you.

If you require any assistance, feel free to let me know in the comments below, and I will try my best to assist you.

Enjoyed the content ? Share it with your friends !

PHP Import SQL database extremely fast

PHP Import SQL database extremely fast

Sometimes when your using a shared host, there are many limitations, including file upload size or memory limit that you cannot control or modify. This will in turn affect whether you are able to import large databases into PhpMyAdmin. Hence, below is an alternative to use php code to import the database instead.

$db_host = 'localhost'; // change this
$db_name = 'db_name'; // change this
$db_username = 'db_username'; // change this
$db_password = 'db_password'; // change this

$sql = file_get_contents('mysqldump.sql'); //change this

$mysqli = new mysqli($db_host, $db_username, $db_password, $db_name);
if (mysqli_connect_errno()) { /* check connection */
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}

/* execute multi query */
if ($mysqli->multi_query($sql)) {
    echo "success";
} else {
   echo "error";
}

Code was referenced from a stackoverflow user that I do not remember anymore

Enjoyed the content ? Share it with your friends !