mysql-workbench

file conversion- .mwb to .sql file

孤街醉人 提交于 2019-12-04 02:23:22
I have a database in .mwb format. I want to use it in eclipse so i need to convert it into .sql format. If anyone know how to do that by using any tool. I think My sql workbench can do that, but don't know how to do that. In the menu click "Database" and then "Forward engineering" (shortcut CTRL+G). UPDATE: Your .mwb file is a proprietary format, which also holds information of the graphical representation in Workbench. Your generated .sql file is a script, which your MySQL server needs to interpret. To create the database you designed via command line write something like this in the console

#1071 - Specified key was too long; max key length is 767 bytes

為{幸葍}努か 提交于 2019-12-04 01:55:08
问题 I this SQL query to create a table: CREATE TABLE IF NOT EXISTS `local_sysDB`.`hashtags` ( `id` INT NOT NULL AUTO_INCREMENT, `hashtag` VARCHAR(255) NOT NULL COMMENT 'hashtag must be unique. Must be saved without #', `accountId` INT NULL, `startTracking` DATETIME NOT NULL COMMENT 'When tracking of the hashtag start', `endTracking` DATETIME NOT NULL COMMENT 'When tracking of the hashtag ends', `channelInstagram` TINYINT(1) NOT NULL DEFAULT 1, `channelTwitter` TINYINT(1) NOT NULL DEFAULT 1,

create primary and foreign key relationship

百般思念 提交于 2019-12-04 01:46:47
问题 I am trying to create a table name accounts . I have created a visual diagram in mysql workbench . I copied sql command from diagram try to create real table from my command line but command line is showing ERROR 1215 (HY000): Cannot add foreign key constraint Here is the query CREATE TABLE accounts( account_id INT NOT NULL AUTO_INCREMENT, customer_id INT( 4 ) NOT NULL , account_type ENUM( 'savings', 'credit' ) NOT NULL, balance FLOAT( 9 ) NOT NULL, PRIMARY KEY ( account_id ), FOREIGN KEY

Error Code 1111. Invalid use of group function

冷暖自知 提交于 2019-12-03 23:03:39
So this works: SELECT c.name AS country_name, c.population AS country_population, SUM(ci.population) AS city_population, ROUND(100*(SUM(ci.population)/c.population)) AS city_population_percent FROM country AS c JOIN city AS ci ON c.code = ci.countrycode WHERE c.continent = 'Europe' GROUP BY c.name But I need to only grab the city_population_percent values greater than 30, so I try this: SELECT c.name AS country_name, c.population AS country_population, SUM(ci.population) AS city_population, ROUND(100*(SUM(ci.population)/c.population)) AS city_population_percent FROM country AS c JOIN city AS

how to open multiple model/database in mysql workbench

大憨熊 提交于 2019-12-03 22:34:27
I have two model 1) Server Model : conneted to remote database which is stored on server 2) Local Host : connected to my pc database is stored in on pc. I want to query to both database tables simultaneously. Each time i have to switch between database model. How to do it? That's a traditional limitation of MySQL Workbench. You cannot open 2 models at the same time in a single instance of MySQL Workbench. On some platforms (like Windows) you can however open multiple instances (just be careful when changing settings, connections etc. as they are shared among all instances, last save wins). On

How to find Missing Indexes in MySQL?

别说谁变了你拦得住时间么 提交于 2019-12-03 20:22:57
5 and i want to identify missing indexes in it. Can somebody please help me to identify ? This will help us to increase the performance of query that leads to application. Rahul Tripathi The best what I can think of is to use the EXPLAIN to check the execution plan of your query with index and without index and then see the difference in query performance. You can also refer: Does MySQL exectution plan depend on available indexes? Using EXPLAIN to Write Better MySQL Queries How to find un-indexed queries in MySQL, without using the log 来源: https://stackoverflow.com/questions/30626876/how-to

MYSQL import: Cannot get geometry object from data you send to the GEOMETRY field

好久不见. 提交于 2019-12-03 17:36:42
问题 I have recently upgraded to MySQL 5.7 and was trying to run a replication from 5.6 master. However the replication fails with the following error: Error 'Cannot get geometry object from data you send to the GEOMETRY field' on query. Turns out it also happens when I try to import data from the mysqldump. Table structure is as follows: CREATE TABLE `locations` ( `location_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `country_id` int(10) unsigned NOT NULL, `name` varchar(100) CHARACTER SET utf8

what is and how to remove tablespace error from my database?

☆樱花仙子☆ 提交于 2019-12-03 17:12:03
Because of loadshading issue, one of the table in my database got currupted. I dropped the table and now I want to create the table again. I'm getting this error : ERROR 1813: Tablespace for table ' zorkif . sys_user_accounts ' exists. Please DISCARD the tablespace before IMPORT. SQL Statement: CREATE TABLE `zorkif`.`sys_user_accounts` ( `UserID` INT NOT NULL AUTO_INCREMENT , PRIMARY KEY (`UserID`) , UNIQUE INDEX `UserID_UNIQUE` (`UserID` ASC) ) What is tablespace and how to discard this tablespace? Is there any command I have to run in query? How to deal with this issue? user3335616 This

Forward engineer is doing nothing in the MySQL Workbench

蹲街弑〆低调 提交于 2019-12-03 16:24:51
问题 I have little experience with MySQL Workbench and need some helps to figure out an issue. I loaded a new EER diagram from a .MWB file in the GUI and was trying to convert it into the SQL with Forward engineer . Initially, I was connected to the localhost and when, I press the Forward engineer... , nothing happens. The figure is as following, I'm working in the Mac OS Sierra operating system. What I am missing here ? Some advice will help from the more expert users. I use MySQL Workbench 6.3

Upgrading to Windows 10 breaks MySQL workbench?

谁说我不能喝 提交于 2019-12-03 15:31:38
问题 I recently upgraded to the released version of Windows 10 using the automatic upgrade feature from Windows 8. In addition to some other stuff breaking, it seems that MySQL Workbench is now broken. The program starts fine, but when you try to connect to a database, you are presented with a fatal error: The type initializer for 'HtmlRenderer.Utils.FontsUtils' threw an exception. This occurs even after a restart and seems to occur every time. 回答1: The issue occurs due to the HTML rendered dll