Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

MySQL Database into text file

Codes here !

Moderators: macek, egami, gesf

MySQL Database into text file

Postby aristotle » Sun Mar 30, 2014 12:33 am

How can i create databases and tables in a text format so i can have all my database command in a text file. Which would let me import it into my host server.
aristotle
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sat Mar 29, 2014 11:40 pm

Re: MySQL Database into text file

Postby seandisanti » Sun Mar 30, 2014 5:46 pm

There are a couple of different ways, depending on your database type and how you interact with it. If you use phpMyAdmin, it is trivial to export a table or tables to a .sql file. then you can either import directly via phpMyAdmin on the server, or if you have command line access on the server you can just run 'source $file' where $file is the full path to the .sql file saved on the server.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: MySQL Database into text file

Postby aristotle » Mon Mar 31, 2014 2:07 am

Thanks a lot Sir! You'r a Master Craft. Wow...keep up the good work.
aristotle
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sat Mar 29, 2014 11:40 pm

Re: MySQL Database into text file

Postby seandisanti » Thu Apr 03, 2014 8:54 pm

I'm glad i could help
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.