Programming :: PHP Auto Removes Stale Sessions On It's Own But Doesn't Remove From MYSQL Table
Aug 24, 2010
I know PHP auto removes stale sessions on it's own, but that doesn't remove them from the MYSQL table. So I was gonna make a cron script that ran once every hour that removed any MYSQL shopping cart item from the table if the original session_id that created it does not exist anymore.
From my understanding a session_id is an "actual" file located somewhere on the harddisk (is it not? correct me if I'm wrong), so I was going to do a simple check for each item in the shopping cart to check for it's original session file, if it didn't exist on the harddisk, then simply remove it from the mysql table.
View 1 Replies
ADVERTISEMENT
Aug 10, 2015
The apt-get autoremove command, I use Debian 8 for some time now and I often install a package, test it for some minutes and remove it then. I noticed that in most cases (if not all, I'm not completely sure) all the dependencies that were installed with the package (mostly libraries, of course) stay installed on the system when I remove the package.
And there is no output of apt-get that there are unnecessary pacakges which I can remove with apt-get autoremove. The autoremove command does nothing.Before I changed to Debian, I used Ubuntu and there all the dependencies are removed with apt-get autoremove when I uninstalled a package.My question is now, is this normal? if there are fundamental differences in which packages "autoremove" removes between Debian and Ubuntu?
View 4 Replies
View Related
Aug 2, 2010
I'm trying to setup wordpress on my server, which of course I need mysql for. I setup a database the other day, which worked perfectly, but I had to start again as I put some information in wrong. Now, I can create a database fine, but when I run
Code:
GRANT ALL ON wordpress.* TO wordpress@localhost IDENTIFIED BY "password";
I get the output:
[code]...
View 13 Replies
View Related
Apr 24, 2009
My co-worker and I are working on this robotics project where robots are controlled over the web. I don't want to go into all the details, but basically the users visit a page where they have access to a PHP-based interface that allows them to send commands to robots in our tech lab (via an intermediate server). Our web server is running Apache.
Anyway, now we need to implement session control, with user-names and passwords so that only certain people can have access to the interface at a certain time, with access to only certain robots, et cetera. We were hoping there was some kind of pre-fab FOSS solution for handling both the session control and maintaining the MySQL user/password database.
My co-worker knows a little PHP, and I know a little MySQL, but we are both noobs enough that we would prefer to do as little of this from scratch as is possible. We don't have a lot of time, and I know it is easy for inexperienced MySQL programmers to introduce security vulnerabilities.
View 1 Replies
View Related
Jan 26, 2011
We have a MyISAM table without .MYD and .MYI files for storing data and index but we can select data from the table. We can't use mysqlhotcopy for backup the table. Each time,we execute mysqlhotcopy, we have the following error: 'dbs.table: is not base table'. How do we repair the table to re-create .MYD and .MYI files?
View 2 Replies
View Related
Sep 23, 2010
I have just run into a baffling error. I have a database set up in MySQL with six tables. My PHP based website performs queries of all kinds on these tables (SELECT, INSERT, UPDATE, DELETE). On my most recently setup table, the "Orders" table, I am able to perform queries from the server, as well as from my PHP MySQL Admin interface, but all activity from my webpage states that the Orders table does not exist. All other tables are running fine. I have tried rewriting the query script, checked for case sensitivity problems, even cut and pasted other working scripts in place, changing the table and field names as needed. No success. What could cause a single table to not show up like this?
View 2 Replies
View Related
Oct 17, 2010
A sed mishap prior to a database import left me with a table name with, eh, well, this: Code: mysql> show tables;
+-------------------+
| Tables_in_someday |
+-------------------+
| day20101016 |
| day20101017); |
+-------------------+
I've corrected the sed mishap and imported the database the way it was intended Code: mysql> show tables;
+-------------------+
| Tables_in_someday |
+-------------------+
| day20101016 |
| day20101017); |
| day20101017 |
+-------------------+
But I can't seem to drop the table day20101017); because no matter how I seem to escape it it errors.
View 1 Replies
View Related
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
Feb 6, 2011
I'd like to use a perl script to update a fields in mysql database when pianobar (command line pandora radio player) starts a new song. Pianobar has the ability to run a script based on events, I'd like to take advantage of and use perl toparse the artist,song,album and update the corresponding fields. Then later retrieve them and display them with php/html. I am by no means proficient with perl. I started to use bash, but it looks like perl will be much more efficient and and less time consuming.
Code:
#! /usr/bin/perl -wT
use strict;
[code]...
View 2 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
Nov 19, 2008
I have this program:
#! /usr/bin/perl
use DBI ;
use strict ;
[code]....
and I get this error simply running the program from the command line: DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 at ./submit.cgi line 24.
is this the right syntax to use, both, for this line:
my (@param) = $cgi->param("firstname","lastname","type") ;
as well as this one:
$sth=$dbh->prepare ("SELECT firstname,lastname,type FROM dts WHERE firstname LIKE $param[0] AND lastname LIKE $param[1] and type LIKE $param[2]" );
or should there be quotes around the $param[0] or something? (also is it $param[0] or $param(0)?)
View 1 Replies
View Related
Oct 23, 2010
I'm using MYTHTV with AT&T's U-Verse system. AT&T apparently turns off the set-top box if the box doesn't receive any commands after some number of hours. When this happens the box takes so long to turn on that it doesn't process the lirc IR channel change command. I've rewritten my channel changer to add a lockfile, and added a cron entry to kick off an entry to just "ping" the set-top box once an hour. But, OK, I'd like to play the bandwidth saving game and not do this if there isn't anything in the "record" table.
So, how would I write a script that will check the number of rows in the "record" table in the "mythconverg" database and exit if there are zero rows? I'm afraid I don't know how to even start this. Here is my "keepalive.sh" script that does the pinging:
Code:
#!/bin/sh
#if there are no rows in the record table, just exit this script
# lock the lockfile - MUST be same one as channel lock
while [ `lockfile "/tmp/mythchanlock.lck"` ]
[Code]....
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
Nov 7, 2010
i have a table in a text file. How can i remove from that table for example "SLS= " if the value is empty? Is it possible to do it in bash awk or sed? [URL]
10.25 SLS=* G.V.=* BBU=122 G.V.=14
10.28 SLS=196 G.V.=198 BBU=* G.V.=*
10.08 U.T.=* I.M=--
10.15 U.T.=-0.522 I.M=*
View 1 Replies
View Related
May 3, 2010
Kmail 1.13.2 Problem on startup, error is from nepomuk, data storage. "cannot find Redland backend, nepomuk is disabled until fixed. Also see the following error from the akonadi console:
100503 10:00:15 [Note] Plugin 'ndbcluster' is disabled.
100503 10:00:15 InnoDB: Started; log sequence number 0 31413862
100503 10:00:15 [Warning] Can't open and lock time zone table: Table
'mysql.time_zone_leap_second' doesn't exist trying to live without
[code]....
View 2 Replies
View Related
Mar 10, 2010
I have a problem with GRUB 2 that I hope someone here can help me fix. Every time I boot I get an error because GRUB deletes that last part of the initrd line in /boot/grub/grub.cfg.
So this:
Code:
Becomes this (notice the missing "c" at the end):
Code:
And the windows part is also broken:
Code:
If I add an extra character at the end of the line it get removed instead and then it works. But only until next time the grub.cfg is auto updated. The error is only there when booting. Reading the file every character is in there.
View 9 Replies
View Related
Sep 29, 2010
I know very little about MySQL, but I've got some users that need it for testing on a Linux server.So I had set it up a while back, but now I'm running into some small problems.Right now, each user has his own database that I created and can do whatever with it. Each user only sees their own database.I didn't want them to be able to create new databases at all, but they can and when they do anyone can see them.
EDIT(Apparently they can only create databases beginning with the word "test" in the name)
I need to either:
1) Stop them from creating new databases (without affecting their ability to interact with the existing database)
OR
2) Make it so that when they create a database, only they have privileges on it and only they can see it (except mysql root of course).
Anybody know the statement to set these kinds privileges up?
EDIT: pfft... I've a read a bit more and realize that this is an intended part of the installation.
EDIT2
I'd still like to remove the ability to make test databases.
EDIT3:Ok, for reference this is how you prevent users from making and using test databases:
shell> mysql -u root -p
Enter password: (enter root password here)
mysql> DELETE FROM mysql.db WHERE Db LIKE 'test%';
mysql> FLUSH PRIVILEGES;
View 4 Replies
View Related
Oct 11, 2010
I have a small problem regarding multiple X sessions. I want 2 X sessions started automatically on boot with 2 different users auto logged in and 2 different sessions running.
On first X session I would like to have gnome running with user1
On second X session I would like to have xbmc running with user2
So far my computer logs user1 in to a gnome session via gdm on boot. But then I have to launch a tty, log in as user2 and then start xbmc in a new X session.
How to make it work? I would also love to have the second X session active after boot. I am running Ubuntu 10.04.
View 1 Replies
View Related
Apr 16, 2010
I try to do a function which removes '#' from beginning of line. But if there is not '#' then add it on beginning of line. I try something like this, can you correct me?
Code:
awk '
!/^#/{ sub(/^[^#]*/,"#$0","'$line'")
}
/^#/{ sub(/#/,"","'$line'")
}'
View 14 Replies
View Related
Jul 6, 2010
1-what is the shell command which allows me to know how many opened sessions on a mysql server?
2- what are the important points we can manage in a mysql server?
View 2 Replies
View Related
Jun 12, 2009
Eventually, does this program already exist for bash/console ?
View 14 Replies
View Related
Jan 6, 2011
I recently installed 32bit maverick and wanted to make it login automatically. I tried enabling auto login from Admin > Login but that didnt work and I was still prompted for my password. Then I went to Users & Groups and changed the password option to Do Not ask for password at login now after I reboot, the user list is shown (only 1 user) and it doesnt ask for password after I click on my username.
However, then it gives a few errors (as i vaguely recall):
1. cannot load .ICE directory in my home directory
2. some error 256 about a gconf-sanity-2 file
3. nautilus cannot load my home directory etc
and then it gets stuck without loading anything (blank wallpaper). i ve tried navigating to my home directory using Alt F2, gksudo nautilus and my home dir contents are encrypted by the ecryptfs (there is a readme.txt file and a shortcut). i have tried to decrypt but it doesnt work... i ve also tried to start/stop gdm, and startx but nothing works. if i stop gdm, then the prompt doesnt recognize my password and keeps on rejecting the commands i enter... I think this has something to do with the home dir not being decrypted due to the dont ask for paswd option... how can i disable the dont ask for pwd without the gui (i can access my / by booting through an external usb).
View 4 Replies
View Related
Feb 3, 2011
I have noticed that a common issue to several distros is the fact that the networking subsystem doesn't automatically detect the link if an ethernet connection is disconnected and then re-connected to the NIC after boot. If the ethernet cable is connected after the system is up and running, nothing happens - ethtool eth0 shows link detected: no, and you have to restart the network service to let the NIC know that there is in fact a link, and actually connect. I have a Fedora14 (KDE) box with a brand new Asus motherboard with embedded NIC. Everything works great except the auto-detect of a freshly connected ethernet connection if the link is down to begin with.
Am I missing a ethernet link sentinel utility or something, or is this just the way linux works? I have done plenty of research on plenty of posts, and it seems this is a common problem, with no solution other than manually or programatically restarting the network service in a script to detect the link after a disconnect.
View 3 Replies
View Related
May 23, 2011
How can I really, really remove everything related to mysql / mysql-server. I read and tried all kinds of things, but on every reinstall there is still old mysql stuff there, for example an existing password. Even resetting the password does not help.
Reason of removal: it looks like the mysql setup is really corrupt, so I want to remove, and then do a fresh install. Running Ubuntu 11.04 64-bit
sander@R540:~$ sudo apt-get purge mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server is not installed,
[Code]....
View 4 Replies
View Related
Aug 7, 2009
I have 2 servers, 1 running a web server on 1 IP address,the other server running a proxy on a different IP address. I intend to change and update the ncsa file with usernames and passwords from a mysql table.Is there a way to replicate 1 table from the webserver to the proxy server databases and then run a cronjob? The cron will simply delete unused usernames and add new ones.Is there a better way of doing this? I don't want to run the webserver on the proxy server for security and also for performance.
View 2 Replies
View Related
Jun 8, 2011
I am trying to install some program: rosinfo: - Create mysql database for rosinfo - Create table hosts, locks. Use file docs/rosinfo.sqlAnd I need to create table hosts, locks, using file rosinfo.sql. I have that file, but dont know what to do with it.
View 1 Replies
View Related
Jul 13, 2011
I've started a webserver at 127.0.0.1:**** I want to be able to use a database for this server. Which schema do I use to add a new table to? Do I create a new Schema altogether?
View 5 Replies
View Related
Jul 6, 2009
When a user logs into my webmail application, it creates entries in a table on MySQL called "identities" which works great however once the user is deleted fro Linux with the "userdel -r" command, the data still sits in MySQL. My question is how I can I remove the table data from old users? It appears as show below:
[code].....
View 1 Replies
View Related
Feb 24, 2009
What is the use of UNION=() in CREATE TABLE?
Code:
ENGINE=MRG_MyISAM DEFAULT CHARSET=utf8 UNION=();
I have been given some code and could not explain why it's err's out. Checked the mysql 5.0 manual but nothing[URL]. It only explains using UNION in a SELECT statement which I understand. If I drop off UNION=() then CREATE TABLE works fine.
View 4 Replies
View Related
Feb 18, 2010
I have tried a few packages but cannot find an easy intuitive interface for editing tables in a mySQL database. I just need to simply edit the table field data, import and export multiple rows, and filter the table data so only the rows are returned based on a string that I search for. The tables I edit have several thousand rows and some up to 30,000. I do not know how to write queries and it seems all these packages require that you know how to write sql queries to do what I need to do. On the mac I used Sequel Pro, which is dead easy to use and is mostly point and click to do all the above. Since my mySQL experience is very limited, I really need something simple like this.
I have tried:
MySQL Workbench
Navicat (lite version)
MySQL Query Browser
how to do what I need to do with the above packages.
View 7 Replies
View Related