How PHP sites upload databases

Source: Internet
Author: User
Tags file copy html file upload
PHP Program Build Station The most troublesome is the database, because PHP must use a separate database, many novice in the construction site upload database often error, the following Hefei PHP training small series and you share:

In fact, with the database of PHP files and we are accustomed to the HTML file upload is similar to the use of dreamwaver with the file upload function, or other FTP software can, according to your own computer total website root directory structure, the file upload can be.

You go to the root of your site can see the auto-generated three folders: Connections and _mmserverscripts and _notes, all the files in the front two folders to upload to the server, _notes yourself, it is mainly responsible for "remove/store Back" function, if you want to use this function, then upload it.

A: The Connections folder in the PHP file opened with Dreamwaver, will be inside the MySQL address, account number, password (these are your own machine on the OH), change to the address of the server you want to upload (general is the URL, note: No./http Www.buleidea.com and use www.buleidea.com), account number and password!

Second: Then you can upload all the files of the site to the server.

Three: Then there's the trouble with the database. There are two ways to upload a database:

1.1 If you are the Server Manager, then have the right to access the server directly on the MySQL but the installation directory, then you just put your own machine on the mysql/data/folder included inside the file copy to the corresponding folder on the server can be. (It is so simple, at first I also think very complex, and want to have what path of the problem ah, in fact, MySQL data connection has its own definition, that is, it through the server directly with the database connection)
If you can not copy or upload files, then you need to stop the server's MySQL, upload and then restart mysql! :)

1.2: If not the manager of the server, it does not matter, you use the phpMyAdmin on your own machine to manage the database on the server, the operation method is the same, but

Your first edit phpMyAdmin config.inc.php, plus a set of MySQL server address, account number and password. As follows

$cfg [' Servers '] [$i] [' host '] = ' server address ';
$cfg [' Servers '] [$i] [' user '] = ' MySQL account ';
$cfg [' Servers '] [$i] [' password '] = ' password ';

Then follow the build database on your own machine, build a table, and put all your tables back on the server's MySQL build again (may be a bit troublesome)

Ok, afraid of trouble, then say another way, just a colleague teaches:)
----------First Use phpMyAdmin to connect your own database on the machine, when you enter a table, you can see there is a pour out, OK, we will pour it out;

1 Click "Pour out"
2 Select the "SQL" method, the default design of other parameters
3 Click "Save As File"
4 Click "Execute"
Then save it anywhere, so you get a *.sql file

Now we're going to pour it into the server now pour it into
1 Create a table with phpMyAdmin on the server and you pour out the same name
2 then select it,
3 Do you see the four small icons on the left navigation bar of the page? Click on the second icon (I do not know what version you use, but you can try), and then will pop up a window, and then it is obvious that you click on the "Pour file", and then click "Browse" Select the file you just poured out, and then execute on OK!!

The above describes how the PHP Web site upload database, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.