Teach you how to deploy your own website on Sina cloud--Connect database

Source: Internet
Author: User

Read this blog before you must look at another blog, Link is http://www.cnblogs.com/-beyond/p/6686166.html

After reading, by default you know how to upload code to the Sina cloud SAE, and can run successfully, before you connect the database, you must first create an application.

Now I'm creating an app called Sampleone, like

Click on the code management on the left, select Create a version on the right

Then you'll see the following page

You can choose to edit the code, you can also choose to upload the code package, but here, for the sake of simplicity, I only create a code file, directly inside the index.php

You've noticed that there are a few parameters to the database, so what do you think?

Select the shared MySQL and create the version

You may find that the name of the database has been determined, beginning with the app, plus your app name, which is different from the database name you have on this computer, so before you upload your database, please change the database name to app plus the appropriate app name.

Click on the management, do not direct point data import, if you will docker technology, you can try

Click Import, then select File Import

After successful import, return to the following interface, select details

You'll see

The area circled in the picture is the parameters of the database connection, $host value is the main library address (or from the library address), $db = "App_sampleone";

Modify the database connection parameters in your code to connect

Test results, perfect operation!

Teach you how to deploy your own website on Sina cloud--Connect database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.