What's SQL equivalent of MySQL SHOW CRAETE TABLE query - mysql

I have a remote SQL Server database that I don't want to copy because of it's size. I want to just remotely import it's creation query to duplicate it's structure locally.
I know there was a query for it but lost somewhere my book about it. I ask for name of that query method that I described. If got any questions please don't hesitate to ask.

I found it. It's SHOW CREATE TABLE http://dev.mysql.com/doc/refman/5.0/en/show-create-table.html

Related

MySQL can't show table after altering auto_increment

I created two tables like this
and I want to change the added data's id so I use
alter table member auto_increment=5;
after this, it couldn't show my member table. It shows
error 2013: lost connection to MySQL server during query.
I thought my table is too big to run, so I changed the limit and the DBMS time out, but it didn't work either. Can someone tell me what's the problem now?
I found the problem. Don't edit your MySQL database when you're connecting it with your Python Flask program. Edit means any CRUD actions.

update mysql from a sql file

Im new to the php and mysql. I have been coding an auto update script. Everything works fine as I can download the latest version files from my own host which includes of the sql file of mysql. All I want to do an update due to this sql file.
What I want this code to do is;
If there is new tables, add it to the mysql and if we have deleted 1 table it can check and delete the same table from mysql.
But while we are doing this update, we will have so many entries under columns so I dont want it to update the columns which has entries in it. But if this is a column that we have deleted from the source sql file then it will delete it.
If there is new column on the source sql file then it will add that column to the mysql.
Any possibility can help me? Try to find if I can find something similiar but I couldnt see. Thats why I opened a topic here.
Thank you very much

Converting SQL server query to its equivalent MySQL for trigger

In SQL Server, we can get the last inserted record using inserted table in triggers. I know the equivalent MySQL statement is NEW. But the question is how to implement that.
A snippet is attached herewith what it shows in SQL Server. I want the very same thing in MySQL. Will it be possible to do that?
I want the output as:
Please give the total implementation. I've tried NEW in different ways those didn't work out.
Thanks.

How do I generate a new table to a DB using SQL in phpmyadmin?

I'll guess the headline pretty much covers my question, however to elaborate on my question a bit further in order to avoid any confusion, I can say that I have found a ready-made table which is in SQL and it is this SQL I would like to know whether or not it is possible to just paste it into phpmyadmin in order to generate the table ?
Thank you in advance
After selecting the database you want to insert your table into, click the "SQL" tab. Then you can paste your SQL right there and that will generate your table for you - provided the SQL is correct.
If you have any trouble, feel free to post your SQL and we'll have a look.
Try the import function on top, select your sql file there. This should create your table which is coded in the sql file.

Is it possible "Database Synchronization"

I have a problem and not sure if this is possible. My web application has a database and i'm using a mysql workbench and using wamp server.
My web app has a database name healthcare, and if I import again another database with the same tables, etc but addition data. I want the first database to be updated only with new values but not replaced.
Is it possible?
Edit: I searched in the net and other related sources and I manage to set my phpmyadmin "Ignore multiple statement errors". When I import the second database (.sql with same tables but with new data) it does not update the first database but the message is successful. Please help, I'll appreciate any help...
in the past ive searched for tools to do some similar database sync tasks - in my experience ive found that none are free & reliable.
have you tried writing some queries to do this manually?
first thing that comes to mind would be figuring out a key you can use to evaluate each row and determine if you should copy said record from database A to database B.
afterwards you could simply do an INSERT(SELECT)
INSERT INTO healthcare_DESTINATION.table (SELECT * FROM healthcare_SOURCE WHERE some_condition = 1);
obviously this is the simplified version - but i've done something very similar utilizing timestamps (eg only copy rows newer than the newest row in the destination table)
hope this helps