is there some way of pulling out the schema of your mysql databases?
I have lots of db and tables inside these databases, and I use phpmyadmin with WAMP in my local machine.
I need to pull out the schema, or atleast the database name, table name, columns and their attributes (e.g. INT(2)
) and export it as csv/ excel/ whatever format which finally can be edited in excel.
i use:
server:
Apache/2.2.21 (Win64) PHP/5.3.8 MySQL client version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $ PHP extension: mysqli Documentation
mysql:
Server: localhost (localhost via TCP/IP) Server version: 5.5.16-log Protocol version: 10 User: root@localhost MySQL charset: UTF-8 Unicode (utf8)
thanks!
You can use
mysqldump
from the console, e.g.The
-d
switch makesmysqldump
to dump the schema only,-r
directs output to a given file. You can also use-X
to write dump in XML format.In the PhpMyAdmin's Export tab for the database, you want:
Check the box : Custom - display all possible options.
Under Format-specific options: section, choose Structure only
Not sure exactly what you want. You can try one of these methods:
1) Use phpMyAdmin's export feature to export the database. PMA allows you to omit the data.
2) You can do the same using mysqldump. This command should export CREATE DATABASE/CREATE TABLE queries:
3) You can pull information from mySQL schema tables. Most mySQL clients (phpMyAdmin, HeidiSQL etc) allow you to export result of queries as CSV. Some useful queries: