acf domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131all-in-one-wp-migration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131rocket domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/studiogo.tech/httpdocs/upcloudold/wp-includes/functions.php on line 6131Setting up UpCloud Managed Databases is your carefree solution to database hosting at any scale. It allows users to deploy professional-grade database services on UpCloud without a moment spent in a manual installation.<\/p>\n\n\n\n
Taking advantage of the expert-managed cluster setups brings huge advantages with minimal effort when comparing the work required to deploy a similar system from the ground up. In this tutorial, we\u2019ll show you how to effortlessly set up Managed Databases and how to connect your application.<\/p>\n\n\n\n
The UpCloud Managed Databases<\/a> are offered in 2 and 3-node clustered configurations with options to scale the services as needed with zero interruption. Unclustered single-node databases are also available which are great for testing and development before effortlessly scaling up to production.<\/p>\n\n\n\n To get started, go to your UpCloud Control Panel and find the Databases section in the main menu.<\/p>\n\n\n\n Deploy your first Managed Database by clicking the Create Database button. This will open up the database configuration options. Make the following selections according to your requirements.<\/p>\n\n\n\n Once finished, click the Create Database Service button to deploy!<\/p>\n\n\n\n Then sit back and relax while your new database service is built.<\/p>\n\n\n\n Managed Databases offer a carefree approach to installation and management while still providing many of the same features as self-hosted databases. After deploying your first Managed Database, you are all set to begin using it like any other database with common database clients.<\/p>\n\n\n\n For this example, we are using the mycli<\/tt> command-line database client. Install the client on your computer or Cloud Server.<\/p>\n\n\n\n Using the client, you can easily connect to the Managed Database with the authentication details as shown in your UpCloud Control Panel.<\/p>\n\n\n\n You can also use the connection string which includes all the necessary authentication details. Below is an example of the connection string.<\/p>\n\n\n\n Note that the Private connection is only available to Cloud Server which is connected to the Utility network and is located within the same data centre as the database. Also, if you\u2019ve disabled the Allow all from the Utility network, you will need to add the Utility network IP address of your Cloud Server to the list of Allowed IP addresses.<\/p>\n\n\n\n For accessing the database from an external location, you will need to enable Public access to the database details. Remember to add your IP address to the list of Allowed IP addresses.<\/p>\n\n\n\n Then use the Connection string which includes the \u201cpublic-<\/tt>\u201d identifier in the database hostname.<\/p>\n\n\n\n That\u2019s all you need, you should now be connected to your Managed Database.<\/p>\n\n\n\n A great benefit of utilising Managed Databases is how the database is run independently from the applications that use it. This approach allows you to make use of the high availability and scalability of the Managed Databases without worrying about downtime of your applications themselves.<\/p>\n\n\n\n In this example, we are deploying a WordPress website to demonstrate the process of connecting to the Managed Database. For this purpose, we will install a simple web server to run WordPress which will then utilise the Managed Database.<\/p>\n\n\n\n Deploy a new Cloud Server or use any existing server within the same zone as your Managed Database. Configure the server as you prefer, for example by using either Ubuntu or Debian operating system.<\/p>\n\n\n\n Once deployed, log in using SSH and install the following packages.<\/p>\n\n\n\n Then download the latest version of WordPress.<\/p>\n\n\n\n Unpack the WordPress site, for example in \/var\/www\/html<\/em> using the following command.<\/p>\n\n\n\n Next, change the DocumentRoot in the Apache default configuration to point to the WordPress directory. The command below should handle that in one go.<\/p>\n\n\n\n Then update the file permissions to ensure the site will be accessible.<\/p>\n\n\n\n Afterwards, restart the webserver to apply all changes.<\/p>\n\n\n\n With the web service side of our WordPress demo ready, continue in the next section on how to connect it with the Managed Database.<\/p>\n\n\n\n Connecting an application to a Managed Database works just like with any self-hosted database. To do so, you first need to create a database for your application, WordPress in this example, and create a username with the required permissions.<\/p>\n\n\n\n Note that you should create separate users and databases for each application. To do so, you can use the mycli command-line client.<\/p>\n\n\n\n Connect to your database from a terminal, for example using the mycli tool and your connection string as displayed in your UpCloud Control Panel.<\/p>\n\n\n\n Once connected, you will be greeted by the default database command prompt.<\/p>\n\n\n\n Create a new database by the name wordpress<\/tt>.<\/p>\n\n\n\n Create a new username defined by the Utility network IP address of your Cloud Server that is hosting your WordPress instance.<\/p>\n\n\n\n Then grant the wordpress<\/tt> user all permissions to the new database. Make sure to include the Utility IP address in the user details to restrict access to the database solely for your own Cloud Server.<\/p>\n\n\n\n Lastly, flush the grant table to make the changes take effect.<\/p>\n\n\n\n When done, exit the database command prompt and close the connecting.<\/p>\n\n\n\n You should now be able to connect to the new database table with the user you just created.<\/p>\n\n\n\n Lastly, configure the same database connection details on your WordPress instance by setting up the wp-config.php file by making a copy of the sample and then editing it as indicated below.<\/p>\n\n\n\n Set the database and username as shown below and replace the <password><\/tt> and <hostname><\/tt> with your own.<\/p>\n\n\n\n When done, save the file and exit the editor.<\/p>\n\n\n\n You should now be able to take WordPress through its initial setup. Open the public IP address of your Cloud Server on your web browser to check. You should see the following configuration screen.<\/p>\n\n\n\n Connecting your application or service after setting up UpCloud Managed Databases is as easy as one, two, three! With quick deployment, you can easily begin developing your next idea without a single worry about maintenance. And when you are ready to unveil your creation, zero-downtime scalability will help you take it to the next level! If you want to learn more, check out our documentation for Managed Databases.<\/a><\/p>\n","protected":false},"featured_media":21440,"comment_status":"open","ping_status":"closed","template":"","community-category":[124,127],"class_list":["post-24931","tutorial","type-tutorial","status-publish","has-post-thumbnail","hentry","community-category-databases","community-category-managed-services"],"acf":[],"_links":{"self":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial\/24931","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/tutorial"}],"about":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/types\/tutorial"}],"replies":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/comments?post=24931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media\/21440"}],"wp:attachment":[{"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/media?parent=24931"}],"wp:term":[{"taxonomy":"community-category","embeddable":true,"href":"https:\/\/studiogo.tech\/upcloudold\/wp-json\/wp\/v2\/community-category?post=24931"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
<\/figure>\n\n\n\n\n
<\/figure>\n\n\n\nConnecting to the Managed Database<\/h2>\n\n\n\n
# Ubuntu and Debian\nsudo apt install mycli\n# CentOS\nsudo yum install mycli<\/pre>\n\n\n\n
mycli --user <username><\/span> --password=<password><\/span> --host <dbname-id><\/span>.db.upclouddatabases.com --port 11550 <databse-name><\/span><\/pre>\n\n\n\nmycli mysql:\/\/upadmin:no76c30yomvf6ado@example-mctapmghasah.db.upclouddatabases.com:11550\/defaultdb?ssl-mode=REQUIRED<\/pre>\n\n\n\n
<\/figure>\n\n\n\nmycli mysql:\/\/upadmin:no76c30yomvf6ado@public-<\/span>example-mctapmghasah.db.upclouddatabases.com:11550\/defaultdb?ssl-mode=REQUIRED<\/pre>\n\n\n\nQuick install WordPress on Cloud Server<\/h2>\n\n\n\n
sudo apt install apache2 php7.4 php7.4-mysql php-common php7.4-cli php7.4-json php7.4-common php7.4-opcache libapache2-mod-php7.4<\/pre>\n\n\n\n
wget https:\/\/wordpress.org\/latest.tar.gz -P $HOME\/<\/pre>\n\n\n\n
tar -zxvf $HOME\/latest.tar.gz -C \/var\/www\/html<\/pre>\n\n\n\n
sudo sed -i 's\/html\/html\/wordpress\/' \/etc\/apache2\/sites-available\/000-default.conf<\/pre>\n\n\n\n
sudo find \/var\/www\/html\/wordpress -type d -exec chmod 755 {} ;\nsudo find \/var\/www\/html\/wordpress -type f -exec chmod 644 {} ;<\/pre>\n\n\n\nsudo systemctl restart apache2<\/pre>\n\n\n\n
Configuring WordPress to use the database service<\/h2>\n\n\n\n
mycli mysql:\/\/upadmin:no76c30yomvf6ado@example-mctapmghasah.db.upclouddatabases.com:11550\/defaultdb?ssl-mode=REQUIRED<\/pre>\n\n\n\n
CREATE DATABASE wordpress;<\/pre>\n\n\n\n
CREATE USER 'wordpress'@'<utility-ip-address><\/span>' IDENTIFIED BY '<password>';<\/pre>\n\n\n\nGRANT ALL ON wordpress.* TO 'wordpress'@'<utility-ip-address><\/span>';<\/pre>\n\n\n\nFLUSH PRIVILEGES;<\/pre>\n\n\n\n
EXIT;<\/pre>\n\n\n\n
mycli --user wordpress --password=<password> --host <dbname>.db.upclouddatabases.com --port 11550 wordpress<\/pre>\n\n\n\n
cp \/var\/www\/html\/wordpress\/wp-config-sample.php \/var\/www\/html\/wordpress\/wp-config.php\nnano \/var\/www\/html\/wordpress\/wp-config.php<\/pre>\n\n\n\n
\/\/ ** MySQL settings - You can get this info from your web host ** \/\/\n\/** The name of the database for WordPress *\/\ndefine( 'DB_NAME', 'wordpress' );\n\n\/** MySQL database username *\/\ndefine( 'DB_USER', 'wordpress' );\n\n\/** MySQL database password *\/\ndefine( 'DB_PASSWORD', '<password><\/span>' );\n\n\/** MySQL hostname *\/\ndefine( 'DB_HOST', '<hostname><\/span>.db.upclouddatabases.com:11550' );<\/pre>\n\n\n\n
<\/figure>\n\n\n\nSummary<\/h2>\n\n\n\n