mysql

Bloated innodb datafile (ibdata1) and how to reclaim space?

I have about 12GB of data in my tables and my datafile, ibdata1, used to be about 12GBs in size. I then ran the following command alter table `rails_production`.`pictures` change `data` `image_file_data` mediumblob NULL While it was making a temporary copy of the table, I got the following error ERROR 1114 (HY000): The table '#sql-7f...

Possible consequences of increasing varchar length in MySql?

I'm using an old table, which has a varchar(40) field in it. I want it to be possible to insert more characters in that field, so I want to increase the length of it. Are there possible negative consequences I should think of before increasing the length? ...

How do I search for names starting wih A in MySQL?

hi, I have a question that how can we use SELECT for searching the name which start with 'A' in MySQL table? thanks ...

What is innodb_buffer_pool_size & innodb_log_file_size?

Can anyone tell me what is innodb_buffer_pool_size & innodb_log_file_size? What will happen after increasing it's sizes.. ...

PRIMARY and INDEX keys for one FOREIGN column in MySQL

I used MySQL Workbench to prepare a database layout and exported it to my database using phpMyAdmin. When looking at one table, I got the following warning: PRIMARY and INDEX keys should not both be set for column gid gid is a foreign index which is the primary key of a different table, and which is also part of the primary key of ...

Search problem in mysql query

Hi I have some problem regarding the search in mysql. Below is my query. SELECT * FROM table WHERE name LIKE "%admin\'s%"; When i am executing this query it will return zero data. actually i have "admin\'s" stored in db. this "\" is to prevent sql injection. i have used mysql_real_escape_string to prevent the sql injection. but wh...

How to Print XrCheckBox in Xtrareports

I have a lot of Y & N (yes & no) fields in an Mysql database. They are basically boolean but are stored as varchar 'Y' or 'N'. I want to display checkboxes which are checked while the database value is 'Y' and to unchecked while database field value is 'N'Whats the best way to bind a XRCheckBox to do these?How i can do it?please help me....

Wrong number of database records is output by a Java program

Hi, I have a table in mySQL and has 3 line which has name ,address,Telephone,Age,Charge. in two of them the names are "Adam" and the last row is "Abas" ,i don't know that why it prints in the console like this,please help me thanks! Statement s; int s4,s5;String s1,s2,s3; List<InfoClass> clientList = null; try { ...

SQL command line

Hi, my friend wants from me to write two queries for him but really I don't know ,would you please help me? also there is a table with two column (String Telephone and BIGIN Charge). the sentences that I want to write a query for that: one: Reduce the “Charge” for all Telephone numbers starting with ‘123’ by 30. two: Update all the Tele...

MySQL linking tables; some final issues

Firstly I want to thank all of you who have helped me understand Normalization and how I should build up my database. Now, I have some final issues left... How does LINKING of tables actually work? Say you have three tables: CATEGORY TABLE: cat_id (PK) -> 1 cat_name -> cars CATEGORY_OPTIONS TABLE: cat_opt_id (FK) -> 1 cat_id (FK) ->...

Application sharing

I Have a windows application made using VB.net and Mysql database. I want to install it on a Local network to be used by several users on different windows machines. How best can I do this? ...

MySQL -- issuing low priority updates

Is there a way to execute low priority updates in mysql? I am running a very high load application where there may easily be literally thousands of users trying to concurrently update the same data records. This is mostly session-based statistical information, much of which could be ignored in case there is a wait time associated with t...

Invoking and executing stored procedure

In MySQL I have a table with name, address, telephone, age and charge column. Assume I have written a stored procedure called calculate_monthly_charges. This stored procedure takes no parameters. How can I write a corresponding code for invoking and executing the stored procedure? ...

whats wrong with this MYSQL QUERY?

$sql = "UPDATE site_ayarlar SET site_baslik = '$_POST[site_baslik]', site_slogan = '$_POST[site_slogan]', meta_desc = '$_POST[meta_desc]', meta_key = '$_POST[meta_key]', meta_auth = '$_POST[meta_auth]', meta_copy = '$_POST[meta_copy]', meta_robots = '$_POST[meta_robots]' "; and error is Parse error: syntax error, unexp...

Any dynamic database frontend tool from which you can update directly?

Hi Gurus, This is with reference to this question where I got one tabular report format. I need to update the user entered values correctly back to the same table rows. I am in the process of doing this by using general form post data methods by using some logics which I think will not be easy to maintain. So, just out of curiosity, Is...

MySql How to set root password to null

How can I change the root password of MySql to null --> ("") from the MySql CommandLine Client ? ...

Time complexity/MySQL performance analysis

Set up(MySQL): create table inRelation( party1 integer unsigned NOT NULL, party2 integer unsigned NOT NULL, unique (party1,party2) ); insert into inRelation(party1,party2) values(1,2),(1,3),(2,3),(1,4),(2,5),(3,5),(1,6),(1,7),(2,7),(5,7); mysql> select * from inRelation a -> join inRelation b on a.party2=b.party1 -...

SQL Server version of MYSQL insert into

I have the following query running on a MySQL, but it fails when I run it on a SQL Server database. How should it look to please SQL Server? INSERT INTO first_table (pk, data) VALUES ((SELECT value FROM second_table WHERE key = 'key'), 'other-data'); ...

Query sql on string

hi all, I have a db with users that have all this record . I would like to do a query on a data like CN=aaa, OU=Domain,OU=User, OU=bbbbbb,OU=Department, OU=cccc, OU=AUTO, DC=dddddd, DC=com and I need to group all users by the same ou=department. How can I do the select with the substring to search a department?? My idea for the s...

MySQL Subquery returning incorrect result?

I've got the following MySQL query / subquery: SELECT id, user_id, another_id, myvalue, created, modified, ( SELECT id FROM users_values AS ParentUsersValue WHERE ParentUsersValue.user_id = UsersValue.user_id AND ParentUsersValue.another_id = UsersValue.another_id AND ParentUsersValue.id < UsersValue.id ORDER ...