Tag Info

Hot answers tagged

10

I stumbled upon this question when I myself had encountered this error. I could finally figure out the configuration. I didn't touch anything in /etc/mysql/my.cnf which already has bind_address = 127.0.0.1. So only localhost can connect. I use OpenSSH server. So in its config file /etc/ssh/sshd_config I changed from no to yes the param responsible for TCP ...


9

You will get this message if you're trying to add a constraint with a name that's already used somewhere else. According to this post you can check your constraint like this: If the table you're trying to create includes a foreign key constraint, and you've provided your own name for that constraint, remember that it must be unique within the database. Run ...


8

After you create a connection to your database, execute the following two commands: USE <DATABASE NAME>; SELECT * FROM <TABLE NAME>; Then MySQL Workbench will show another pane with the results. This will be the entire contents of the table.


7

BOOL and BOOLEAN are synonyms of TINYINT in MySQL. See MySQL docs: Numeric Type Overview You probably want to use the BIT datatype.


6

It is a very poor practice to expect to maintain the PK/FK relationships from the application. In any db that is nontrivial, data has close to a 100% chance of being changed from other sources including ad hoc queries, data imports, etc. It is irresponsible to think the data in the database is protected because the application has protections. Sure you think ...


5

I think the TCP/IP over SSH approach works by establishing a "normal" SSH connection underlying the MySQL connection (in the same way as you would tunnel using -L with the OpenSSH command-line client). Therefore, you'd need to specify a connection to an SSH server on server via which you're establishing the tunnel. Here, you seem to be using ...


5

I have some queries you can run against the INFORMATION_SCHEMA Run this to get the Total MySQL Data and Index Usage By Storage Engine SELECT IFNULL(B.engine,'Total') "Storage Engine", CONCAT(LPAD(REPLACE(FORMAT(B.DSize/POWER(1024,pw),3),',',''),17,' '),' ', SUBSTR(' KMGTP',pw+1,1),'B') "Data Size", CONCAT(LPAD(REPLACE( ...


5

The icon shows that that side of the relationship is not mandatory, meaning the field can be NULL. You can change that if you click on the relationship line, go to Foreign Key tab and select the Mandatory check box.


4

http://code-remind.blogspot.com.au/2011/12/on-macbookpro-10.html NOTE: Where the author suggests using the path '/Applications/MAMP/bin/stoptMysql.sh' at the end... there's a typo. Should be '/Applications/MAMP/bin/stopMysql.sh'


4

Believe it or not, although the products went EOL December 18, 2009, the last versions of MySQL Query Browser and MySQL Administrator are still available for download for free. Hey, I still use them today. Click here and get it while Oracle isn't looking ... QUICK !!!


4

You many need to take a look at the comprehensive list of all Server Variables. Some of them you can change for the duration of your session, some you may change with the SET GLOBAL command, and other options may require a restart of MySQL. Here is the list of all options. This will also show which options can be used in option files.


4

MySQL Workbench does not have the capability to "infer" the relationships from table column names, or MyISAM tables. It requires that the constraints be defined in the database or SQL script being reverse engineered.


4

You will need to give root@localhost a password Since you just installed mysql, you are running with default settings, this means you have no my.cnf. You will have to create one. Run the following at a DIS Prompt cd C:\Program Files\MySQL\MySQL Server 5.5 dir *.ini There, you will see sample .ini files. Let's pick my-small.ini net stop mysql cd ...


4

From the MySQL Workbench 5.2 window, select Database -> Synchronize model which will allow you to synchronize the model (EER diagram) with the database (you need to create a saved connection) for it. I recommend this method over just reverse engineering the model from the database since it maintains the layout of the EER diagram. One caveat is that you ...


4

What idexes do you have on this table? If the dbms engine is doing a full table scan, it will completely load a cpu and take a long time. If you have a 2 cpu system and all your data is in RAM, then you'll see 50% cpu usage. Please create and index, such as CREATE INDEX BlueBoxEngineDB.TransferIdx1 ON BlueBoxEngineDB.Transfer(Amount,FromUserId,Status); ...


4

You can use the INFORMATION_SCHEMA database and the COLUMNS table in particular Example of use: SELECT table_name, column_name, data_type, ordinal_position FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = 'myDatabase' --- the database you want to search AND column_name = 'name' ; --- or: column_name LIKE '%name%' ...


3

SET @given_id = 1; SELECT name FROM table1 WHERE id = @given_id ;


3

No worries my friend! Your database was not compromised. The systems administrator had this problem as well this week. We found out after he cursed across the room! After sending a call to our hosting provider, Heroku, it turned out that they were doing a test on a selected amount of machines (most likely on their Cedar stack) and created test schemas as a ...


3

To expand on @ypercube's answer (He gets a +1), if you do not know which database the table resides, do this: SELECT table_schema, table_name, column_name, data_type, ordinal_position FROM INFORMATION_SCHEMA.COLUMNS WHERE column_name = 'name' ; --- or: column_name LIKE '%name%'


3

I see a few issues with your existing code to create the waiters table. First, the index creation code is incorrect. The column to be indexed should be inside the parentheses -- INDEX (manager_id). Second, you are trying to add an index on a column that is not listed in your waiters table. You need to include the manager_id as a column. Third, the ...


3

See File -> Export -> Forward Engineer SQL Create Script...


3

While you seem to have fixed the issue, I will quickly explain why it happened in case anyone finding this will want to understand where the problem was. When setting foreign keys, the Primary Keys Columns must be of exact same type and attributes. E.g. If you have unsigned attribute on one primary key, you must have it on another. If you have INT data type ...


3

You can take a backup from the live MySQL with Xtrabackup. Percona provides deb repository for Ubuntu. To install the repo for Ubuntu 12.04 follow instructions: Install the key: # apt-key adv --keyserver keys.gnupg.net --recv-keys 1C4CBDCDCD2EFD2A Add the source file: # cat /etc/apt/sources.list.d/percona.list deb http://repo.percona.com/apt precise ...


3

Maybe the problem is that the Workbench is running your statements one at a time without you being noticed, while JDBC exactly sends to the database what you exactly ask it to send. See this answer, where a parameter is used on the connection driver to allow many SQL statements over a single JDBC statement object.


2

You may need to check the users in the mysql.user table. Run this query: SELECT user,host FROM mysql.user; You should see something like this: mysql> SELECT user,host,password FROM mysql.user; +------------------+-------------+-------------------------------------------+ | user | host | password | ...


2

Free and open source SQuirreL?


2

The account that you are using to log into PHPmyAdmin/Workbench may not have permissions on the required tables. Do you see the required tables when you use the same login in the MySQL monitor console? Try logging in with a higher privileged account and viewing again.


2

There are big differences between the two. The datatypes are different (e.g. Oracle doesn't have the ENGINE part, int(5) is invalid for Oracle, LONGTEXT is invalid for Oracle and so on) and part of the syntax as well. Oracle does not have an "autoincrement" column. It has a different concept using sequences. If you want to find all the differences you will ...


2

To be frank, if you are using a GUI tool as your backup strategy, you are doing it wrong. Backups need to be scripted, automated, and regularly tested or else you might as well not have them. If your database is very small (a few gigabytes), there is no point in doing incremental backups: backup the entire database with mysqldump and use binary logs in ...


2

Not having worked much in MySQL Workbench, your question prompted me to downloaded it to look around. It looks to me that the export panel is just a GUI to issue a mysqldump command. mysqldump is a program that can only be used to get a snapshot of the current state of the database. Aka, there is no comparison feature to get 'latest changes since the last ...



Only top voted, non community-wiki answers of a minimum length are eligible