简体   繁体   中英

How can I use uploaded .sql database in filezilla which I have been exported through xampp server.

I am making a site in PHP. I have registered a domain and uploaded my PHP pages in filezilla using that host address and password. But I don't have any Idea about how to use database which I have made in xampp server. Somewhere I found an answer stated as 1.Export your database into a * .sql file 2.upload it to your webserver 3.In a php page, do commands to connect to your database, and then run a command like this:

mysql_query("SOURCE path/to/sqlfile.sql");

Then hit that PHP page with your web browser

Can any one help me explaining this solution more precisely. I mean what command should I give in PHP page for connecting to database.

If there is any other way to use database of xampp server then pls suggest me. I will be thankful Your answers.

You have to install mysql. Ubuntu:

sudo apt-get install mysql

Then in php you can create a mysql object

$db=new mysqli($host,$user,pass);

http://www.php.net/manual/en/book.mysqli.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM