Where is the Database File stored in PHP - php

I've Installed XAMPP Server, and running localhost for web development Purposes. And Database used is MySQL, In MySQL installation i've created a user named "Rahul" And set a Password for that user.
And this PHP script :https://www.dropbox.com/s/mxeq8o2cryvmps5/Php.php?dl=0
Returns "Database created successfully", So where is the Database file stored Physically on my PC,
How can i Find the Database (.db/.mdb) File, So as to directly View and Upload to a hosting server?

Open phpMyAdmin and Click on database which you want to you want to upload to the server.
then click on Export option and then choose SQL and press go.
It will create the .sql file which contains all the queries which will create exact copy of your database on server.
and if you currently wanted to see which data it contains then export that database in other format such as CSV or wordpad or PDF format...
While you want to upload that database on server just go in phpMyAdmin of server and import that .sql file...

Related

Working with .sql file

I'm having an old project which have server language is php. The project have .sql file database. How can we deal with this .sql file (i.e open in database program like MySQL workbench) to see the list of table and the corresponding data type, and real data type store in that table?
Any help is much appreciate.
P.S.: My php folder is zip and download from production server. I need to find out the incorrect data in .sql table (i.e see table content, real data inside)
.sql file is actually a database dump. You will have to import it using any MySQL management tool like phpmyadmin or MySQL workbench. See this thread
How can I import data into mysql database via mysql workbench?

How we update our local database to server database daily in PHP

I tried to create a PHP script to update our local database to server database, when we click a button "Upload data" from PHP script.
I searched but could not find any PHP script for that.
How can we update our data to server. I checked MySQL replication, but we want it through PHP script.
You could dump the data from one database into a local file
e.g. using https://github.com/2createStudio/shuttle-export
and then you can import that into another database.
e.g. Import mysql dump using php

MySQL in XAMPP stops unexpectedly whenever an activity is created in MOODLE

First of all we created a moodle site on our local machine. Afterwards we integrated our work using TFS (Team Foundation Server). Now we changed the ibdata1 file in our database which includes the change of all people and took the latest version of the site from TFS. But now whenever any activity or resource is being created in MOODLE site, mysql stops unexpectedly and says DATABASE READ AND WRITE ERROR; while login takes place effectively and reads the username and password from database. The error message shows that your database must be corrupted or you may not have the priveleges or block port or shutdown by another method. While log shows database "you have moved .frm files to another database?
or, the table contains indexes that this version of the engine
doesn't support." and sometimes "The InnoDB memory heap is disabled". Please help.
Have you copied the database frm files rather than doing a data dump? This won't work. You need to do a database dump and restore.
On the original server either use phpmyadmin or mysqldump. Phpmyadmin should be already installed by xammp
If the server is your local machine, you can access phpmyadmin via
http://localhost/phpmyadmin
Then go to database name, click the export tab and click go. This will download an sql file.
Then on the destination server, do the reverse. Go to phpmyadmim, you will need to create a blank database, then click the import tab and select the sql file.
Also copy the moodle data folder, this is a straight forward copy.
http://docs.moodle.org/26/en/Moodle_migration
Don't try to merge 3 databases, the id's will be out of sync and the data will be completely useless.
If the code from the other developers has been written correctly, they will have install.xml files and possibly upgrade.php or install.php files to make any structure changes to the database.
http://docs.moodle.org/dev/Upgrade_API

Get old MySQL data from old mysql folder and import into new database

On my older computer's HDD, I have WAMP5 installed with MySQL and PHPMyAdmin. The data is in the folder. How do I get that data that is in three files? The data is at E:\wamp\bin\mysql\mysql5.5.24\data\fbdb, I can see it.
I want to import the country table to the fbdb database, these are the files I have from it: country.MYD, country.frm and country.MYI
What do I do with these files to add to new database?
Assuming you've created an 'fbdb' database on the new computer, just copy the country.* files you've found into the 'fbdb' folder under your new machine's MySQL data directory, and restart the MySQL server -- as long as it's the same version or newer as the MySQL server on which the table was created, this should be all you need to do, as the MySQL engine will automatically check, and if necessary update, the 'country' table from those files.
You should export and then import the desired parts of your database from your old disk to your new disk, or even the whole database. First you export what you need into a file then you can use that file to import it into the database. Read this forum thread for more information.

How to upload database(php)?

I have develop one web site in php.
I know how to upload it using ftp(filezilla).
But i dont know how to upload database and i can't do any thing without uploading this database.
please help me to upload my database.
Thank you.
tl;dr version
Ask your hosting provider what methods they support.
More detail
It all depends on your hosting. Do you have a simple hosting account with only FTP access (i.e. no command line or remote desktop access)? In these cases your host usually has phpMyAdmin installed or an alternative web based database management system.
It's unlikely, but you could also try connecting to your MySQL database from your computer. You can download the command line tools or simply get MySQL Workbench, and put in your hostname and test the connection.
If you do have shell access, you can dump your local database with mysqldump and upload the resulting SQL file, then import that on the server. A similar technique can be used with remote desktop.
Normally you could make a gzipped .tar.gz of your DB dump and upload it with a file client to your space... once done unzip it and restore from dump using a mysql commandline or some GUI provided by the site admin.. i'm assuming your DB is MySql as its the obvious choice and you have the privilege to access the DB.... this question seems more suited for serverfault as it seems to have less relation to programming in general. Anyhow
To Tar:
tar –cvzf tarfilename foldername
Untar:
tar –xvzf tarfilename
Example:
tar –cvzf abc.tar.gz abc
This will zip [tar] the abc folder with the name abc.tar.gz
tar –xvzf filename.tar.gz
This will unzip [untar] the file as abc folder.
To backup and restore from dump please refer this link as it has some brilliant illustration.
If you're using MySQL, just export the database from your localhost (phpmyadmin)(click on the database and then search for the export tab ).
When you export it, you need to import it to your online host (your domain).
And to do this, you have to have access to the cpanel of your host.
After logging in to your cpanel , search for phpmyadmin (or whatever database you're using).
Create a database and import your database.

Categories