简体   繁体   English

如何在通过xampp服务器导出的filezilla中使用上载的.sql数据库。

[英]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.

相关问题 我在wamp服务器上创建了一个名为“ credentials”的数据库,其中包含“ userinfo”表。 我无法通过php连接数据库 - I have created a database named 'credentials' having 'userinfo' table in it on wamp server. I am not able to connect the database through php 使用PHP如何显示已在SQL中保存为图像路径的图像 - Using PHP how can i display images which have been saved in SQL as a image path 如何通过从mysql / phpmyadmin导出为mydatabase.sql的php / pdo连接到sql数据库? - How to connect to sql database through php/pdo that has been exported from mysql/phpmyadmin as mydatabase.sql? 我如何用php显示哪些图像已经在输入类型文件中上传? - How I can show which image has been uploaded inside input type file with php? 如何验证文件已上传? - How do I verify that files have been uploaded? 在请求 SQL 结果后,如何对它们进行排序? - How can I order SQL results after they have been requested? 我无法在Filezilla上下载使用“ move_uploaded_file()”代码上传的图像 - I can't download images uploaded with “move_uploaded_file()” code on filezilla WordPress:来自服务器的意外响应。 该文件可能已成功上传。 签入媒体库或重新加载页面 - WordPress: Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page 来自服务器的意外响应。 该文件可能已成功上传。 签入媒体库或重新加载页面。 WordPress 媒体 - Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page. Wordpress media 来自服务器的意外响应。 该文件可能已成功上传。 签入媒体库或重新加载页面 - Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM