Software :: Completely Emptying Column In MySQL
Mar 25, 2010
I have a database with the following table (see below). What I need to do is to empty the itype column completely, so that if I do a Select itype from items; it will return empty set. I have tried dropping and recreating the itype column, but it just adds the data I want to insert to the end, and even when I recreate it, it is not empty.. I need to overwrite it, or better, start with an empty column.
mysql> desc items;
+----------------------+--------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+--------------+------+-----+-------------------+----------------+
| itemnumber | int(11) | NO | PRI | NULL | auto_increment |
| biblionumber | int(11) | NO | MUL | 0 | |
| biblioitemnumber | int(11) | NO | MUL | 0 | |
| barcode | varchar(20) | YES | UNI | NULL | |
| dateaccessioned | date | YES | | NULL | |
| booksellerid | mediumtext | YES | | NULL | |
| homebranch | varchar(10) | YES | MUL | NULL | |
| price | decimal(8,2) | YES | | NULL | |
| replacementprice | decimal(8,2) | YES | | NULL | |
| replacementpricedate | date | YES | | NULL | |
| datelastborrowed | date | YES | | NULL | |
| datelastseen | date | YES | | NULL | |
| stack | tinyint(1) | YES | | NULL | |
| notforloan | tinyint(1) | NO | | 0 | |
| damaged | tinyint(1) | NO | | 0 | |
| itemlost | tinyint(1) | NO | | 0 | |
| wthdrawn | tinyint(1) | NO | | 0 | |
| itemcallnumber | varchar(30) | YES | | NULL | |
| issues | smallint(6) | YES | | NULL | |
| renewals | smallint(6) | YES | | NULL | |
| reserves | smallint(6) | YES | | NULL | |
| restricted | tinyint(1) | YES | | NULL | |
| itemnotes | mediumtext | YES | | NULL | |
| holdingbranch | varchar(10) | YES | MUL | NULL | |
| paidfor | mediumtext | YES | | NULL | |
| timestamp | timestamp | NO | | CURRENT_TIMESTAMP | |
| location | varchar(80) | YES | | NULL | |
| onloan | date | YES | | NULL | |
| cn_source | varchar(10) | YES | | NULL | |
| cn_sort | varchar(30) | YES | | NULL | |
| ccode | varchar(10) | YES | | NULL | |
| materials | varchar(10) | YES | | NULL | |
| uri | varchar(255) | YES | | NULL | |
| itype | varchar(10) | YES | | NULL | |
| more_subfields_xml | longtext | YES | | NULL | |
| enumchron | varchar(80) | YES | | NULL | |
| copynumber | varchar(32) | YES | | NULL | |
+----------------------+--------------+------+-----+-------------------+----------------+
37 rows in set (0.05 sec)
View 4 Replies
ADVERTISEMENT
Dec 1, 2008
I am writing a script to mine data from my game server logs which are going to mysql. My first question is syslog-ng is sticking $msg into one colum it self, $msg tends to be a long string here are a few examples:
cn name team frag death flags role host.
0 Maik CLA 2 0 0 normal *.70.233.118.
1 lizardncd RVSF -1 3 0 normal
[*.22.247.40] lizardncd fragged Maik.
And they are not always in the same format, How could I parse this data to do something useful, like creating a user stats page with frag counts and flag counts. Should I create a script that runs in a cronjob that parses this data to a new table maybe once a day. Even then the $msg string value is random and I am thinking in terms of awk.
Second. I would like to keep track of what ip's are using what nicknames. Kinda in the sense of and ip associated to a array of names that have been used on that ip address so I can keep track of users. How would this work logically with a mysql db, could a column allow multiple values, then loadable into an array, which then can add, remove, and store to mysql.
View 1 Replies
View Related
Jan 31, 2010
Target F12 mysql - 5.1.42-2
Source FC 5 mysql - 5.0.27-1
I've put SElinux into permissive mode as it was practically denying anything that moved. Both installed from the standard repos. I used mysql-administrator to create a backup of the FC5 server (all databases/tables) and transferred it to the new system. I restored it onto that machine and double checked that my standard admin user (full privs) was present and let me log in to make changes. All good so far.
So I copied over my files from my sites, point a browser at them and I get nothing, not even errors. Now it's a long while since I set the original up and have probably forgotten something simple but despite making the error output more verbose I can't seem to track anything down other than:
[Code]....
So it suggests my tables are invalid/trashed but I can't seem to figure out why. The original server is still running happily so I'm not in any rush to fix this, I'll keep plodding, Phpinfo reveals a normal operational php setup, so i think that side of the sites is functional. Apache test pages work on blank virtual hosts but viewing my sites reveals the favicon working fine but otherwise comepletely blank pages (zero output, even source). I tried running the page as a raw CLI input to the php package using php index.php and php returned nothing, logged nothing unusual but sat with my CPU at 100%, unsure if that is related.
View 1 Replies
View Related
Jul 27, 2011
I have two different table in a database in mysql that has no share key with each other and I want to sort them with each other on their date time column I mean when I sort it row X of table A that is older that row Y of table B comes earlier.
View 3 Replies
View Related
Jun 13, 2011
I am trying to import a data file from old DOS application into MYSQL table The file is clear text file with fixed-width columns, without column delimiters
Example file :
Code:
4444333666666
2222666555555
iiiiwwwcccccc
[Code]...
View 3 Replies
View Related
Feb 12, 2011
I seemed to configure my gammu and changed the version indicated version on my gammu table from 10 to 11 to match the version of my sql, upon starting my gammu-smsd the error:
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
gammu-smsd[3429]: Error code: 1054, Error: Unknown column 'Signal' in 'field list'
Kept on repeating on an infinite loop
View 3 Replies
View Related
Jul 24, 2011
I recently screw up mysql server privileges and now im having problem accessing tables/databases. so i wanna uninstall mysql server completely and reinstall it. i installed it previously through yum install mysql mysql-server. how should i do it?
View 4 Replies
View Related
Nov 15, 2010
I just install Ubuntu on a new computer I got, and set up LAMP. I started poking around in MySQL (more than I should have) and managed to break it. I've been trying to fix it, but I can't. I've done apt-get --purge mysql-client, but when I reinstall it it's the same thing. How can I reinstall MySQL (and PHPmyadmin) from a completely clean slate? (There's no important data on there)
View 1 Replies
View Related
Jul 20, 2010
I Installed the maintained package, Day one everything worked fine, I set a dummy database and work on it from VM windows. Day two weird errors, I searched around couldn't find the problem, the error was related to The root user losing privileges. I don't remember the exact error. So I decided to Completely remove the DB with apt-get remove mysql-Server-5.1. It gets stuck during the uninstall, I left the machine for a day and a half to uninstall mysql. I realized it was no use, I tried to Restart and try again, but I am getting the same thing.
Code:
finito@finito-desktop:~$ sudo apt-get remove mysql-server-5.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
dbconfig-common libhtml-template-perl mysql-server-core-5.1 libaprutil1-ldap
apache2-mpm-prefork apache2-utils libmcrypt4 apache2.2-common libt1-5
libaprutil1-dbd-sqlite3 apache2.2-bin wwwconfig-common php5-common
javascript-common libjs-mootools
Use 'apt-get autoremove' to remove them.
The following packages will be removed:
mysql-server-5.1
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 15.7MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 231901 files and directories currently installed.)
Removing mysql-server-5.1 ...
it stays stuck at Removing mysql-server-5.1 ...
I can't progress I am at the brink now, my only option right now is format, but I don't wanna do that. This setup is almost 5 years old and I have gone with many ups and downs with it. From Windows to 8.04 to 8.10 to 9.04 to 9.10 to now 10.04 each year loving the resilience of Ubuntu and the Linux architecture. I don't want to believe that this has killed my spree.
View 9 Replies
View Related
Feb 24, 2010
I have the following perl/DBI script:
Quote:
#!/usr/bin/perl
use DBI;
my ($db, $user, $pw) = ('dbname', '****', '***********');
my $dbh = DBI->connect("DBI:mysql:$db",$user,$pw) or die "Cannot connect to $db: $DBI::errstr
[code].....
The error message is
[Wed Feb 24 13:03:27 2010] myscript.cgi: DBD::mysql::st execute failed: Column count doesn't match value count at row 1 at myscript.cgi. [Wed Feb 24 13:03:27 2010] myscript.cgi: DBI::db=HASH(0x8a30c60)->errstr
View 2 Replies
View Related
Jul 19, 2010
How would i calculate following values.Initial file
10 3
20 4
How would i calculate 3rd column which should be addition of value in 1 and 2nd column.File after calculation
10 3 13
20 4 24
View 14 Replies
View Related
Jul 15, 2010
I have a multicolumn datas, like
a1 b1 ... f1
a2 b2 ... f2
. . ... .
[code]...
I would like to make a file with all these data in one column, like
a1
a2
.
.
[code]....
Can it be done with awk or some other command? Also, is it possible then do add another column in front of this one with numbers of the lines (for every previous column), like
1 a1
2 a2
. .
. .
[code].....
View 14 Replies
View Related
Mar 7, 2010
i use this script to get the time and date of back and fourth transactions for a particular execution id. I use a substr command on the 5th column to to cut the milli seconds off the time value. - otherwise the times would look like 08:30:04.235
grep <executionID> <auditfile> | awk '{ print $1, $2, $3, $4, substr($5,1,8}
FIX -> Mon 3/1/2010 08:30:04
FIX <- Mon 3/1/2010 08:32:36
FIX <- Mon 3/1/2010 08:35:08
[code].....
anyhow - i append two sed commands to further clarify the direction of the message.
awk '{ print $1, $2, $3, $4, substr($5,1,8} | sed -e 's/->/ ->IN/g' | sed -e 's/<-/<-OUT/g'
FIX -> IN Mon 3/1/2010 08:30:04
FIX <- OUT Mon 3/1/2010 08:32:36
[code]....
I tried using an awk gsub () command within the string instead of the two seds, but it did not work:
awk '{ print gsub(/<regex>/, <replace with>,$1), $2, $3, $4, substr($5,1,8}
the sed works ok, but it would be cooler to make the replacement within the awk command:
gsub(/->/,-> IN, $1)
Is there a way where i could replace the value of the $1 column in the awk print string?
View 1 Replies
View Related
Jul 12, 2011
recently we decided to make our own panel (like Plesk or cPanel) but for Ubuntu and it will be licenced under GPL (like any other professional sofware).want to make a panel not only that fits our needs but also the needs of other system administrators and domain owners. We researched other panels and found out that non of them has security/look/ease of use in one package. Bad codig is another problem found in other panels.I made a short overwiev of what I think we have to have in the beginning.I Security :1. Completely chroot enviornoment where every single service is in chroot mode (bind,mysql, postfix, .... )2. Easily managed IPtables trough web-based interface. 3. Coding rules has to be strict.
II Software selection :
1. MTA - Postfix
2. POP - dovecot
[code]....
View 7 Replies
View Related
Jan 25, 2010
My Trash applet always shows that there are 2 items in the trash can.
Its driving me insane.
I tried sudo rm -fr /home/*/.local/share/Trash to no avail.
Where is the trash folder in karmic? I had to create the Trash folder in home first.
Has it been moved from the /home tree?
View 3 Replies
View Related
Oct 3, 2010
Evolution Mail I have a bunch of messages from last August stuck in the Deleted box. Other deleted messages are emptying ok. how I can get rid of them? I do a regular back-up and restore but they just won't go away.
View 7 Replies
View Related
Feb 11, 2011
Have 10.10.Is it possible to recover data having just emptied the Wastebasket?
View 3 Replies
View Related
May 28, 2010
I'm using Evolution, latest version for Linux. For some reason, I can't get the deleted items folder in the mail view to expunge. Is there some reason why emptying the trash suddenly doesn't work? It worked for the first few days of using Evolution, but now it just doesn't work -- the deleted items just stay there.
Here's the error message:
Error storing '~/.evolution/mail/local/Handle Later (mbox)': Error storing '~/.evolution/mail/local/Sent (mbox)': Error storing '~/.evolution/mail/local/Inbox (mbox)': Summary and folder mismatch, even after a sync
View 8 Replies
View Related
Sep 17, 2010
How to deal with this error. The folder that this refers to does exist, so I dont know why I'm getting this error when I try to empty my trash in Evolution.
View 5 Replies
View Related
Jul 9, 2010
I am 61 years old and brand new to Ubuntu. My son built a computer for me which I am using. I hated Windows so he installed Ubuntu 9.10 which I love. My son left for the Air Force Academy and when he left he told me and I was on my own so I am doing my best to learn. Everything was going fine but today I encountered a problem.
When I tried to empty my trash in the Evolution Mail program, I encountered this error message:
Error while Expunging folder.
Error storing '~/.evolution/mail/local/Sent (mbox)': Summary and folder mismatch, even after a sync
I googled the error and found this solution:
I first used Evolution File > Backup Settings. Then I went to my .evolution/mail/local and deleted all files that had an extension of:
.index
.cmeta
but NOT .data
When restarted it takes a few minutes to rebuild. Then I was able to successfully delete everything in my trash folder. I have looked and looked and I cannot find the .evolution/mail/local folder. How to get to it. Or perhaps am I using the wrong corrective action. If that is the case, then what should I do.
View 5 Replies
View Related
Aug 4, 2011
Banshee is, at seemingly random intervals, emptying any playlist I have imported (as .pls generated by Rhythmbox). The playlists I build in Banshee directly are not suffering this emptying problem. (There is one imported playlist, of some 30+, which has not yet emptied but I see nothing special about it.)
View 1 Replies
View Related
Sep 25, 2009
This message comes up when I try to upgrade. The upgrade needs a total of 400M free space on disk '/'. Please free at least an additional 394M of disk space on '/'. Empty your trash and remove temporary packages of former installations using 'sudo apt-get clean'.
View 2 Replies
View Related
Jul 21, 2011
Wish a script which would delete cache content and remove additional files which have been downloaded via the internet and saved voluntarily by the user and files any thing other than those used by the OS in linux.Need a command which could make the execution of the above script possible before the shut down command is passed.
View 1 Replies
View Related
Jun 7, 2011
I think this goes here, but I'm not sure. I decided that XAMPP had been troublesome enough. MySQL never worked. So I decided to instal the LAMP stack offered by YaST. I went about installing it thinking that it would all work. But it seems that I was wrong. So I try to start mysql, and here's what I get:
Code:
the-matrix:~ # mysql start
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2) or
Code:
the-matrix:~ # rcmysql start
Starting service MySQL warning: /var/mysql/mysql.sock didn't appear within 30 seconds
chmod: cannot access `/var/run/mysql/mysqld.pid': No such file or directory
[Code]...
View 6 Replies
View Related
Jun 2, 2010
i am using liferay5.2(mysql included in the download pack) on fedora. while liferay is working fine but i cannot connect to mysql.i am getting the error
[
[root@localhost ~]# ln -s /var/lib/mysql/mysql.sock /tmp
[root@localhost ~]# /etc/init.d/mysqld start
Timeout error occurred trying to start MySQL Daemon.
[code]....
i didnt find the mysql.sock file in the location /var/lib/mysql/mysql.sock. i cannot find the portal-ext.properties file also to make intial settings.
View 9 Replies
View Related
Jun 17, 2010
I have installed Mysql in Ubuntu 9, for the use of roundcube database.After installing iam getting the error like this
* Stopping MySQL database server mysqld [ OK ]
* Starting MySQL database server mysqld [ OK ]
* Checking for corrupt, not cleanly closed and upgrade needing tables.
So because of this in the roundcube configuration its giving the error message that MYSQL is not installed. So Kindly give me a idea how to solve this.
View 1 Replies
View Related
Aug 25, 2010
I'm having problems connecting to the mysql database on my system. I first noticed this when I was trying to set up the program anymeal. I subsequently tried using MySQL Administrator (mysql-admin), but had no luck. It gives my the following feedback:
Code:
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Click the 'Ping' button to see if there is a networking problem. I press the ping button, and it seems to connect.
Code:
View 4 Replies
View Related
Dec 6, 2010
I've downloaded and installed MySQL-client-5.1.53-1.glibc23.x86_64.rpm. I'm rather new to linux so it might be I haven't started the server. Unfortunately I have no idea which file is responsible for that. It is also possible that my head isn't functioning correctly ( if at all ).
Error I receive is:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
View 6 Replies
View Related
Jan 14, 2011
i was trying to allow remote access to mysql by following mysql was running perfectly until i got here :
Code:
/sbin/iptables -A INPUT -i eth0 -s 192.168.1.0/24 -p tcp --destination-port 3306 -j ACCEPT
i changed my.cnf bind-address line to : "bind-address = 127.0.0.1" and nothing
[code]....
View 4 Replies
View Related
Aug 7, 2010
How do I create a new mysql user and a mysql database at the shell prompt?
View 1 Replies
View Related