[英]How can I use uploaded .sql database in filezilla which I have been exported through xampp server.
I am making a site in PHP. 我正在用PHP创建网站。 I have registered a domain and uploaded my PHP pages in filezilla using that host address and password.
我已经注册了一个域,并使用该主机地址和密码在filezilla中上传了我的PHP页面。 But I don't have any Idea about how to use database which I have made in xampp server.
但是我对如何使用我在xampp服务器中制作的数据库一无所知。 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: 我在某个地方找到了答案:1.将数据库导出到*
.sql
文件中。2.将其上传到Web服务器中。3.在php页面中,执行命令以连接到数据库,然后运行如下命令:
mysql_query("SOURCE path/to/sqlfile.sql");
Then hit that PHP page with your web browser 然后使用网络浏览器访问该PHP页面
Can any one help me explaining this solution more precisely. 任何人都可以帮助我更准确地解释此解决方案。 I mean what command should I give in PHP page for connecting to database.
我的意思是我应该在PHP页面中给出什么命令来连接数据库。
If there is any other way to use database of xampp server then pls suggest me. 如果还有其他方法可以使用xampp服务器的数据库,则建议我。 I will be thankful Your answers.
我将很感激您的回答。
You have to install mysql. 您必须安装mysql。 Ubuntu:
Ubuntu:
sudo apt-get install mysql
Then in php you can create a mysql object 然后在php中可以创建一个mysql对象
$db=new mysqli($host,$user,pass);
http://www.php.net/manual/en/book.mysqli.php http://www.php.net/manual/zh/book.mysqli.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.