Error Pasting Long Query Into Terminal
mysql database < /location/of/statement.txt
Is there a limit to the number of lines a statement can have in a terminal window?
OK, so I just tried the same query on another server and it works in that terminal window? Is there a clip board or cache that needs to be cleared from mysql every once in a while? Why would it work on one and not on another.
View Complete Forum Thread with Replies
Related Forum Messages:
-bash: Mysql: Command Not Found Error In Terminal
Im on Mac OS 10.5 and I have enabled PHP and installed MySQL. A phpinfo page works so I know that PHP is working. I have started the mySQL server running from the system preference pane for mySQL. I am following instructions from the free chapters of 'Build Your Own Database Driven Website Using PHP & MySQL' by Kevin Yank (Off this site) and it tells me to change the root password for MySQL. It tells me to enter the command: mysql -u root mysql I do this and then the terminal comes up with the error: -bash: mysql: command not found I am pretty sure I have followed the instructions in the book accurately so I am not sure what is wrong.
View Replies !
Long Query
Heres my query that will not show up the correct data SELECT * FROM `table` WHERE (`field1`="data1" AND `field2`="data2") AND (`field3` LIKE '%abc%' OR `field4` LIKE '%abc%') It seems not to factor in the first two field's correctly.
View Replies !
When Is A Query Too Long?
I'm just curious to other opinions on the whether you should start to break the sql query in question up, into 2 queries maybe? I have the problem at the moment where I am pulling data from 5 different tables, subqueries and all! I am just not entirely happy with the size of the query and wanted to hear other opinions, Do you try to simplify the query by breaking it up? All tables are normailised (to the best of my ability) and index accrodingly so all that is ok, I am just curious to hear anybody else's thoughts on this.
View Replies !
Long Text Into A MySQL Field Error
I am having a problem putting a certain length of text from a textarea form element into a mySQL field. The field is set to LONGTEXT but I get an error. Whne I shorten the text it writes to the DB with no problem. I am getting a long strng, perhaps 200 characters or more into a variable that will then be written to an mySQL DB but I am getting an error in the DB. How can I set the field to accept more than 400 or 700 text characters?
View Replies !
Data Too Long For Column At Row 1. Error 1406
get the following error whilst doing a jdbc insert: data too long for column at row 1 1406 The row throwing the error is a BLOB. The data I am inserting is a fairly large XML String, though I doubt it is beyond the BLOB limit or even close as I can easily copy it into notepad and execute the same query from mysql query browser. Mysql 5.0.51 win2003
View Replies !
Take Long Time To Run A Query!
I have a webserver that I just use for a webapplication. PHP, Apache and MySQL is installed on the server. The size of MySQL database is 10 GB. End inn it is millions of rows. I wonder where I search what is the normail time the data to return? In my case it takes from 20 sec to 2 min to run a query!
View Replies !
BLOB - Error 22001 Data Too Long For Column
I'm using .net connector and attempting to store a c# byte[1200] array into a BLOB field in my InnoDB table. I'm getting the error: {"#22001Data too long for column '_ch1RawData' at row 1"} If I change the array to have a length of 120, it seems to work OK. This makes no sense to me, 1200 isn't too big? From what I have read, a BLOB's max size is 2^16 + 1 which puts me safely in the valid size range for this array.Here is a snip of code that I'm using to save the blob: <code> MySqlCommand command = new MySqlCommand( Settings.Default.AddTestResultSprocName, connection); command.CommandType = CommandType.StoredProcedure; //.. code that opens the connection, etc command.Parameters.Add( new MySqlParameter("_ch1RawData", ch1Raw)); command.ExecuteNonQuery(); </code> Does anyone see a problem with this?
View Replies !
Table Query Taking WAY TO LONG
I have a query that is inner joined with another table based on country codes Select distinct Name.* from Name inner join Location on Location.key = Name.key and Location.cc in ('<list of countries here>'); The problem is when I have more than 2 country codes, the query takes forever... When I show processlist, it says converting HEAP to MyISAM ( this takes over an hour )... I've tried bumping up max_heap_table_size to 128M and tmp_table_size to 128M, but that only seems to delay the converting HEAP to MyISAM message.... Name contains about 3 million records and Location contains about 1.5 million records. Code:
View Replies !
Query Takes A Long Time
On my site I have a query that searches through 1,7 million. The php-file with the query takes a bit of time to load. Is it possible to show some sort of progress-bar during this time?
View Replies !
Terminal Bell
Does anyone have an idea how to disable to very, very loud terminal bell on windows XP when using MySQL? Everytime I enter a typo in a command or whatever, my eardrums are about to break because of the redicilously loud terminal bell. It's a minor issue, but I wuold still like to keep my hearing abilities as they are... Muting the XP doesn't seem to have any affect on this terminal bell.
View Replies !
Windows Terminal Service
Can anyone tell me what command i need to write inorder to do a mysqldump of a particluar database? I'm currently running a dedicated server. I am accessing mysql.exe from within Windows Terminal Service so i need to know how to write the mysqldump from here.
View Replies !
Terminal - Command Not Found
I've installed Mysql 5.1.25rc on my macbook but I'm not able to start mysql. i open Terminal, manually go to usr/local/mysql/bin but when I type mysql -u root it says command not found. The server is running. EDIT - I've updated the file called .profile and inserted the path usr/local/mysql/bin but with no success. I've updated the .bash_login file (i've read this somewhere on the internet) and after opening that file in terminal (typing . ~/.bash_login ) when I type mysql, even in root, it opens mysql. NOW THE PROBLEM IS: if I try any command (eg. SELECT) it says ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user. What am I doing wrong?
View Replies !
Cannot Run MYSQL Within Konsole Terminal
I have installed MYSQL using the urpmi commands within Mandriva. I am now trying to get this to work but when I type in mysql in the terminal I get the following error. [root@localhost ginge]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Have I missed out any packages? I installed the following... Packages apache-mod_auth_mysql-3.0.0-17mdv2009.0.i586, apache-mod_auth_mysql-3.0.0-17mdv2009.0.i586 are already installed Packages mysql-administrator-5.0-1.r12.5mdv2009.0.i586, mysql-administrator-5.0-1.r12.5mdv2009.0.i586 are already installed
View Replies !
Terminal Problem Using MAMP
Ive set mamp up on my mac and although i know i can use phpamin to manipulate mysql i want to use the terminal to do it. so i cant even get myself dumped on the mysql command line. I cant seem to find the path to mysql. I think the right path is to the folder which contains mysql and mysql admin...but im not sure. In order to get to this folder i type this:: cd /applications/MAMP/Library/bin; This works but i dont know what to type next so i can get in to mysql and inout the default user name and password using this: -u root -p.
View Replies !
Sending BLOB To MySQL Get Error &"Data Too Long For Column&"
I am writing an application in VB6 that requires that an image be saved into a MySQL table. Whenever I run the app I get the message shown above. The app is being developed in VB6, as this is what I am used to. VB6 has the latest patch and I am using the latest ODBC connector for Mysql. There mus be something that I am doing wrong as all of the other fields insert correctly.....
View Replies !
Connect To Remote Mysql Through Terminal...help
Is it possible to telnet or ssh to my paid webhost's mysql through the terminal on mac os x without installing mysql locally? (using the terminal to control mysql ). I really don't want to install it locally if I can avoid it as I wont be using my computer as a server. If so how?
View Replies !
Using Terminal To Configure MySQL Database On Mac OS
I am in the process of installing and configuring MySQL and PHP internally on my Macintosh so that I can go through the tutorials in the book "Build Your Own Database Driven website using PHP & MySQL." I am on the step where I have to change my root password. I'm pretty sure that I've done everything up to this point correctly. I just keep getting the same error message when I try to connect to my MySQL database using this command: mysql -u root mysql Upon pressing enter, I get the following error message: -bash: mysql: command not found
View Replies !
Aes_Encrypt Error Data Too Long Even For Text Data Type
I am trying to insert data into a table with the column data type as text while using aes_encrypt, I get a warning ( if mode is traditional ) "data too long" I even tried varchar(500) and still get the same error. BEcause of this aes_decrypt does not work. I guess the data is getting truncated I am using version 5.0.27 in Linux 2.4 Kernel It works absolutely fine in a Windows machine
View Replies !
Specified Key Was Too Long?
when I change the column datatype to varchar[1024], and set it as primary key, mysql 5.0.12 give me a error. Specified key was too long; max key length is 1024 bytes. but how can i increase it, because when i use sql sever 2000, it can work.
View Replies !
Specified Key Too Long ...
I'm migrating a client's cms to a different hosting provider. Their database for the site was originally built on MySQL 4 structure. Their new provider let's me choose between 4.1 and 5.0. I chose 4.1 but have trouble importing it. I'm using phpMyadmin ... and I got this error: #1071 - Specified key was too long; max key length is 1000 bytes
View Replies !
Getting Around Long Insert
On my signup page, I have to submit roughly 70 variables to a table. Only a few of these are based on user input, so I was wondering if, when I create the table before I have to worry about this, I can set entries to have a default value (Much like how AUTO INCREMENT works)...
View Replies !
Long Blob
I'm trying to update a longblob field and it throws back an error provided from a mysql class that I've developed in PHP. I'm trying to figure out what I'm doing wrong here. This is my query: UPDATE `orders` SET order='0' WHERE id='16'; order is the longblob field.
View Replies !
#1071 - Specified Key Was Too Long
When I execute this query I get 1071 - Specified key was too long; max key length is 1000 bytes CREATE TABLE `playlists` ( `playlistid` BIGINT NOT NULL AUTO_INCREMENT , `playlisttitle` VARCHAR( 255 ) NOT NULL , `username` VARCHAR( 255 ) NOT NULL , `created` DATETIME NOT NULL , `lastupdated` DATETIME NOT NULL , PRIMARY KEY ( `playlistid` ) , UNIQUE INDEX `playlists_title` ( `playlisttitle` , `username` ) , CONSTRAINT `playlists_username` FOREIGN KEY ( `username` ) REFERENCES `users` ( `username` ) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE = InnoDB DEFAULT CHARSET = utf8$$
View Replies !
Connection Needs Too Long
I have a MySQL Server 5.0.21 with a Windows NT 5.0 System and try to connect with en Delphi application through ZEOS-Components over local network. My Problem is that the connect to the WinNT server needs nearly 20 seconds, where a connection to an Windows 2000 system just needs 1 second. Are there any problems that i should know?
View Replies !
Cannot Add Long Text To DB
can anyone help I have built a very basic news feature - which allows users to add news stories to a website. However, the MySQL database doesn't seem to be accepting multiple paragraphs of text it only accepts one or two words. I have altered the field to longtext - but it doesn't make any difference.
View Replies !
Long Queries Priority
I have a 120M record table that needs to have indexes added as a background process. While running the CREATE INDEX command, which is taking several days, all other SELECT queries on the same machine (on a different database) are slowed dramatically. Is there a way to reduce the CREATE INDEX priority so that other SELECT queries can still function at normal speed? The OS is linux, and I have tried to 'nice' the caller script, which works for shorter queries, but presumably the longer queries are running entirely in the MySQL process that isn't 'nice'.
View Replies !
Long Old UPDATE Statement
I have the following SQL which gives me the row Im after SELECT * FROM staff, staffemails WHERE staff.users_username='$user' and staff.staff_id = staffemails.staff_id thing is I now want to perform an update on the result of this query. Ive tried UPDATE staffemails SET is_registered ='0' WHERE staff.users_username = '$user' and staffemails.staff_id = staff.staff_id .
View Replies !
MySQL Taking Too Long
I'm trying to run a php script written by someone else, not me, and it's getting stuck in a particular step. Actually it isn't getting stuck per se, but the browser is, because it's taking forever to return the results back to the browser. Here's the line that's responsible for this: $users = $db->query_return_array("SELECT * FROM user"); It's getting stuck because in my database I have over 60,000 records. Now, I'm just wanting to get over this step (it's an upgrade script), not looking for fancy proper methods of php coding. What alternative ways are there for me to prevent the browser from timing out? I'm guessing some way of looping through the records, and updating the client with simple update characters to prevent it from timing out.
View Replies !
Long Blob Select
select * from s_proc where content = 'asiufhasiu' the scrambling field was copied from the control panel of the binary field. Is it possible to do straight query on the control panel directly against the database/tables?
View Replies !
Monitor A Long Insert
Is there a way to know at what stage is a long Insert/Replace query, as how many rows have been inserted? Besides the time counter I've found nothing to do it.
View Replies !
Process Running Long
2874 mysql 24 0 143m 132m 3756 S 0.0 6.5 1296:37 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid- 6 root RT 0 0 0 0 S 1.2 0.0 47:31.78 [migration/2] 3188 mysql 16 0 143m 132m 3756 S 0.0 6.5 9:55.19 /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid- Is there any way I can prevent this? This server just has forums on it and thats it. It seems its a runaway process or an orphaned connection. Is there any way to have all processes killed after a certian amount of time like php has in its config file.
View Replies !
Restrictions For Long Sql Queries
are there any restrictions for long sql queries in mysql? I havnt found any info about that. Example: select id from example where id > 1000 and ( ( suche like 'wasser %' or suche = 'wasser,%' or suche = '%,wasser,%' or suche like '%,wasser %' or suche like '% wasser,%' or suche like '% wasser %' or kat1 like 'wasser%' or kat2 like 'wasser%' or kat3 like 'wasser%' or motiv like 'wasser') and ( suche like 'sturm %' or suche = 'sturm,%' or suche = '%,sturm,%' or suche like '%,sturm %' or suche like '% sturm,%' or suche like '% sturm %' or kat1 like 'sturm%' or kat2 like 'sturm%' or kat3 like 'sturm%' or motiv like 'sturm') and ( suche like 'glas %' or suche = 'glas,%' or suche = '%,glas,%' or suche like '%,glas %' or suche like '% glas,%' or suche like '% glas %' or kat1 like 'glas%' or kat2 like 'glas%' or kat3 like 'glas%' or motiv like 'glas') )
View Replies !
Varchar And Long Text
I would like to know that usage of longtext instead of varchar will affect the performance or speed of database? Suppose I am using longtext as datatype for all the alphanumeric fields in a table will that slowdown the database performance? Or is it will be the same as using Varchar for all alphanumberic fields?
View Replies !
Why Does `alter Table` Take So Long?
I'm working with a large table of product orders (6.7 million records), and I've run an Alter Table query to drop an index and three columns. It has been running for about five hours now, but I don't think it has crashed. I'm surprised that it takes so long, after all, I'm simply asking to delete information. Is this typical, or could there be something wrong? Is 6.7 million records simply too much for a single table? If so, what would be a good way to restructure the database to make things better?
View Replies !
Data Too Long For Column
Running 5.0.37-community-nt on windows 2003 server. Having problems getting data to insert into blob table. I receive data too long for column. The file I'm pushing up is 578k. I can do smaller files, like 10k. All this worked until I upgraded from linux to windows and mysql from 4.0.16. Orginally the inserts into this table would cause the entire database to crash. Windows event log showed a DR WATSON error. The mysql error log showed a normal shutdown. Should be noted that this failure actually occured without even naming the blob field name, ie 'INSERT INTO TABLE(ID) VALUES('1')'. I went ahead and just dropped the blob column, added it back with same name, and am now we getting the 'too long for column' message. I've read that this could be a character set issue, however in changing it to what one of the mysql engineers suggested, it still didn't work, and also other queries began failing. ie Code:
View Replies !
Data Too Long With Backslash
I want to insert a row into a table. I use the command "source file.sql" to do that. Into my table, I have a "char" field, with size 16. My problem, is that they are quotation mark, so I must use backslash. Example: INSERT INTO .... VALUES( "test "note" test", ... => If want to insert this, I have this error: ERROR 1406 (22001): Data too long for column 'V_DESC' at row 1 Why mysql count the backslash chars ?
View Replies !
Joins Taking So Long?
Here is my SQL which I am running in MYSQL... select * from acct, custunq where custunq.custno=acct.custno; It should return about 250,000 records. The problem is, it takes about 2 minutes just to return 10,000 records so that would be what... an hour or so just to do this query. I have to be doing something wrong, it only takes like a minute to run within Access, and I thought MySQL was supposed to be faster?
View Replies !
Extremely Long Sql Queries
I have a website based on phpnuke and phpbb (run on mysql). Recently i am experiencing extremely high loads on the server. When i checked the sql records i saw several queries like this one : # User@Host: yehidataf[yehidataf] @ localhost [] # Query_time: 217216307 Lock_time: 0 Rows_sent: 2 Rows_examined: 4 SELECT * FROM nuke_banner WHERE type='0' AND active='1'; When i try to run the query by myself it takes normal amount of time (0.0008 sec or less). What can cause this jump in execution ? my host said it might be caused by an error with php (loop in the code) but that does not seem logical as a loop should create repeated calls to the sql database (shouldnt it) ?
View Replies !
Long Text Display
I am kind of new to php/mysql, I am just now starting to learn some of the basics. I have a website that is dedicated to movies/musicals/plays reviews, and as of now it's not connected to any database, but eventually I would like the information to be stored in mySQL.....
View Replies !
Avoiding Long SQL Statements
I am making queries from php. Some of my SQL statements are getting long. I have some that are six lines long and involve 5 tables or more. I can imagine that my queries are going to get longer. They are starting to be un maintainable. How can I improve the situation?
View Replies !
Storing Long String
If I have a very long string of characters (say 30,000) how would I store this in a mysql table. Obviously I wouldn't use the VARCHAR type but this is the only one I know/am used to. If I have to compress/format the string to store it how would I access the string to do functions on it like read the 15,000th character.
View Replies !
Update Takes Too Long, I Need Help
here is my update SQL string: update prices, legend set prices.legend_id=legend.id where ( (prices.id between 1 and 10006) ) and prices.a_legend=legend.description running time: 63.97960 as you see prices has 10006 records and legend table arround 349 records please advice how to speed up this?
View Replies !
How Check How Long Did My Select Took ?
I have a client for mysql which give me the time it took to query but now is very doubtful. I have 2 machines on the same network accessing the same database one is showing 360ms and the other is showing 5469ms on the same select? Thus I am very confuse where can I verify which is the exact time ? Thanks.
View Replies !
How To Insert A Long Xml String In Mysql
I am trying to insert a long XML string in a blob field in mysql. So i am just using a normal insert statement is there an xml function i could use. This way I do have to keep escaping special characters in the xml string when inserting. e.g i am using insert into table values('test','test','test','xmlstring') Some rows go through but other records do not so does anyone know how i could insert an xml stirng which is everything from an xml file but in string format already.
View Replies !
Restore :: Taking Long Time
I've got a table with over 400,000 records. I did a mysqldump to ensure I could restore it in case of problems. Sure enough, problems arose and I needed to do a restore. The mysqldump created the usual create database, create table and one gigantic insert statement, where all 400,000+ records are inserted. I started my restore around 10pm or so yesterday and was surprised to wake up this morning and find it still running. Considering the dump itself took a couple of seconds, why is the restore taking so long? I'm building a website that's going to have tons of traffic. A database restore that's going to take multiple hours seems to be unacceptable. One way to speed up the process would have been to simply copy the actual database files and just stick them back in the data directory.
View Replies !
#1406 - Data Too Long For Column
I want to use a open source software, before the installation. I need to create the database. I can actually, create the database in a good way. When i add the data, i give me '#1406 - Data too long for column 'e_content' at row 1 ' error for the database table gui_element -> 'e_content' field, is set as LongText datatype. I'm not sure this is the limitation of mysql or not. I'm guess it may be some memory problems. Can anyone helps me. i have about 2.00MB sql file, and one of the insert statement caused this error as below: ================================================================================= INSERT INTO gui_element( fkey_gui_id, e_id, e_pos, e_public, e_comment, e_element, e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles, e_content, e_closetag, e_js_file, e_mb_mod, e_target, e_requires, e_url ) VALUES ( 'wms_australia', 'content', 2, 1, 'text', 'div', '', '', 10, 50, 500, 30, 2, 'font-family: Arial, Helvetica, sans-serif; font-size : 12px; text-decoration : none; color: #808080;', 'This GUI is an OGC service catalog container and does not provide a map user interface. Please use the (<a href=''javascript:history.back()''>back</a>) link to select another GUI form your list or log off to log on using another account (identity).<br><br>Diese GUI ist ein OGC Service Katalog Beh�lter (Eimer, Container, nimm was Du meinst) und beinhaltet keine Kartenoberfl�che. Verwenden Sie diesen (<a href=''javascript:history.back()''>back</a>) Verweis, um aus der Liste eine andere GUI auszuw�hlen oder melden Sie sich ab, um sich mit einer anderen Kennung anzumelden. ', 'div', '', '', '', '', '' );
View Replies !
|