Is there any database schema generation tool that creates schema diagram
by importing the mysql .sql database schema file.
I believe that MySQL Workbench is what you're looking for.
I haven't done it myself, but it does support importing of SQL files.
Also you can point your existing DB to Workbench and create a schema graphically and do what ever changes you prefer.
Then you can export a set of new changes to a different SQL so, you can easily upgrade your production databases.
Related
I have a PostgreSQL schema file, and I have an SQL dump from a MySQL database. I want to know how I can import my MySQL dump file into Postgresql, using the postgresql schema file.
You cna't direct restore mysql dump file into postgres
You use psotgresql wiki or specific software trasnfer like:
Postgresql wiki
ESF Database Migration Toolkit
Can you install another MySQL, load the dump there, and export the data in CSV format? This should allow you to load the data into PostgreSQL, using the COPY command.
when I go to the database I created in mysql I just see a db.opt, .frm and .ibd file types. Is there a way to create a .mdf database file so I can further create my project in visual studio?
To use a MySQL database in Visual Studio, you need to use Connector / Net and MySQL For Visual Studio. This code works well and will allow you to use MySQL with the various features of VS.
Or you need to transport the data from MySQL to SQL Server. There are tools to do that if you must.
See here. http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html
It is true that some MySQL databases have on-disk structures that use .frm and .ibd files. But those files are intended to be accessed pretty much exclusively by the MySQL server process.
It's also true that the mdf file is an ondisk structure for SQL Server. These files aren't transportable like .xls files or other "document" files.
1) You do NOT want to "extract a MySQL database as an .mdf file". Instead, you want to export a MySQL database to a SQL server database.
2) SQL Server uses any of the following files - at a minimum, you need a "primary database file" and a "log file". But you absolutely need MSSQL to manage these files for you:
.mdf - Primary database data file.
.ndf - Other database data files i.e. non Primary.
.ldf - Log data file.
3) So how do you export? If you're familiar with MSSQL SSMS (the MSSQL GUI), you might want to consider using the Export/Import Wizard. Here is a good "howto" on using MSSQL "import" tools:
http://www.mssqltips.com/sqlservertutorial/2205/mysql-to-sql-server-data-migration/
4) Alternatively, you can also use phpAdmin to "export" into MSSQL:
http://www.waynezim.com/2010/03/how-to-export-mysql-database-to-mssql-using-phpmyadmin/
5) Finally, if all you want to do is access mySQL data from an MSVS C# or ASP.Net program ... there's really no need to export/import at all. .Net allows you to access mySQL data directly:
http://dev.mysql.com/doc/connector-net/en/connector-net-visual-studio.html
Good luck - and let us know what you find works best for you!
I have a database. All I want to do is dump ALL the existing data in every table to I can then use it to simply import the SQL to my new database?
Im presuming the dump will be a bunch of MySQL INSERT statements
You can also use mysqldump, native mysql tool for this purpose.
You can use a tool such as mysql workbench or phpmyadmin to create the dump.
It will be a bunch of inserts as well as all the other data in it (such as procedures).
I just joined a project where they have been using SQLite. I am more comfortable using MySQL with PHPMyAdmin. If I install phpMyAdmin and work with that will it do any damage?
It is a php project. They have alot of code (sloppy code thats so hard to figure out) for accessing a SQLite db. I dont want to effect that but I want to add some new tables to a new db using mysql and phpmyadmin which i am yet to set up because I'm afraid it will break the code written for the SQLite db
.
Are you talking merely about installing PHPMyAdmin to manage a SQLite database? That won't work, since both use completely different API's to be accessible through PHP.
Or do you wish to swap the SQLite database with MySQL and then use PHPMyAdmin to manage the database? That'll work, as long as the project supports both SQLite and MySQL.
Is it a PHP project? Probably not - mysql_-prefixed methods only work with MySQL as far as I know, and SQLite and MySQL don't listen on the same port by default, do they?
You need to work with what is deployed. If the project is using Sqlite, then use that. Databases are not all equal. If you use something different, your code might not even run on the production databases.
first of all, if you don't want affect, create a branch on github then from work this branch ..
you can also dump all table of this sqlite database to a sql file, then import this file to your phpAdmin, will create the table, since this both manager uses sql language ... just remove some ligne of code that are not compatible with mysql on sql file that you dump data from sqlite dabtase .....
here is the code for dump a sqlite database ....
first select the database on terminal on your project director
sqlite3
./open DATABASENAME
.output YOURSQLFILENAME.sql
.dump
.quit
at this stage you already have your database in a sql file
then use php admin to import this file
if it show some error, just try to remove somecode that aren't compatible with mysql on sqlfile.
Caveat: I have zero experience with MySQL.
I've been given a series of files to do a data conversion and would like to migrate the provided data into SQL Server 2008. The files are:
*.myd
*.myi
*.frm
These file types, as I understand it, are MyISAM. I believe that if I had a running MySQL instance, migrating to SQL Server would be fairly straightforward. I could could either use SQL Server's import wizard or Microsoft SQL Server Migration Assistant for MySQL v1.0. Unfortunately, these files are what I'm stuck with -- I just don't have access to the original MySQL instance.
I also don't presently have MySQL as a running instance locally and I'm not sure if there would be compatibility issues with the files I have.
Can I attach them to MySQL 5.5 with the goal of performing a SQLDump or perhaps to use either tool mentioned above? Am I missing a better way?
Yes, you can easily attach them to MySQL 5.5. Then you can dump the tables using mysqldump (be aware that you will need to either modify dump and remove mysql-specific stuff from the dump, or probably customize mysqldump output - check mysqldump documentation for details). You can also try to link Mysql instance to SQL Server, and then copy tables using SELECT ... INTO [sql_server_table_name] FROM [mysql_table_name].
In any case, the hardest part is to migrate stored procedures/triggers. Mysql and SQL Server have quite a different syntax for them, so you probably cannot automate this process.
Update
Also, I forgot to mention that you will have to modify mysql auto_increment columns to IDENTITY([next_auto_increment_value],1) SQL server.